本文整理汇总了C#中Lucene.Net.Index.AtomicReaderContext.Reader方法的典型用法代码示例。如果您正苦于以下问题:C# AtomicReaderContext.Reader方法的具体用法?C# AtomicReaderContext.Reader怎么用?C# AtomicReaderContext.Reader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.AtomicReaderContext
的用法示例。
在下文中一共展示了AtomicReaderContext.Reader方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSimScorer
public override sealed SimScorer DoSimScorer(SimWeight stats, AtomicReaderContext context)
{
BM25Stats bm25stats = (BM25Stats)stats;
return new BM25DocScorer(this, bm25stats, ((AtomicReader)context.Reader()).GetNormValues(bm25stats.Field));
}
示例2: GetDocIdSet
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
{
SortedSetDocValues docTermOrds = FieldCache_Fields.DEFAULT.GetDocTermOrds(((AtomicReader)context.Reader()), Field);
long lowerPoint = LowerVal == null ? -1 : docTermOrds.LookupTerm(LowerVal);
long upperPoint = UpperVal == null ? -1 : docTermOrds.LookupTerm(UpperVal);
long inclusiveLowerPoint, inclusiveUpperPoint;
// Hints:
// * binarySearchLookup returns -1, if value was null.
// * the value is <0 if no exact hit was found, the returned value
// is (-(insertion point) - 1)
if (lowerPoint == -1 && LowerVal == null)
{
inclusiveLowerPoint = 0;
}
else if (IncludeLower && lowerPoint >= 0)
{
inclusiveLowerPoint = lowerPoint;
}
else if (lowerPoint >= 0)
{
inclusiveLowerPoint = lowerPoint + 1;
}
else
{
inclusiveLowerPoint = Math.Max(0, -lowerPoint - 1);
}
if (upperPoint == -1 && UpperVal == null)
{
inclusiveUpperPoint = long.MaxValue;
}
else if (IncludeUpper && upperPoint >= 0)
{
inclusiveUpperPoint = upperPoint;
}
else if (upperPoint >= 0)
{
inclusiveUpperPoint = upperPoint - 1;
}
else
{
inclusiveUpperPoint = -upperPoint - 2;
}
if (inclusiveUpperPoint < 0 || inclusiveLowerPoint > inclusiveUpperPoint)
{
return null;
}
Debug.Assert(inclusiveLowerPoint >= 0 && inclusiveUpperPoint >= 0);
return new FieldCacheDocIdSetAnonymousInnerClassHelper(this, context.Reader().MaxDoc(), acceptDocs, docTermOrds, inclusiveLowerPoint, inclusiveUpperPoint);
}
示例3: GetDocIdSet
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
{
return new FixedBitSet(context.Reader().MaxDoc());
}
示例4: Explain
public override Explanation Explain(AtomicReaderContext ir, int i)
{
Explanation inner = Weight.Explain(ir, i);
Filter f = OuterInstance.Filter_Renamed;
DocIdSet docIdSet = f.GetDocIdSet(ir, ((AtomicReader)ir.Reader()).LiveDocs);
DocIdSetIterator docIdSetIterator = docIdSet == null ? DocIdSetIterator.Empty() : docIdSet.GetIterator();
if (docIdSetIterator == null)
{
docIdSetIterator = DocIdSetIterator.Empty();
}
if (docIdSetIterator.Advance(i) == i)
{
return inner;
}
else
{
Explanation result = new Explanation(0.0f, "failure to match filter: " + f.ToString());
result.AddDetail(inner);
return result;
}
}
示例5: Explain
public override Explanation Explain(AtomicReaderContext context, int doc)
{
PayloadNearSpanScorer scorer = (PayloadNearSpanScorer)Scorer(context, ((AtomicReader)context.Reader()).LiveDocs);
if (scorer != null)
{
int newDoc = scorer.Advance(doc);
if (newDoc == doc)
{
float freq = scorer.Freq();
Similarity.SimScorer docScorer = Similarity.DoSimScorer(Stats, context);
Explanation expl = new Explanation();
expl.Description = "weight(" + Query + " in " + doc + ") [" + Similarity.GetType().Name + "], result of:";
Explanation scoreExplanation = docScorer.Explain(doc, new Explanation(freq, "phraseFreq=" + freq));
expl.AddDetail(scoreExplanation);
expl.Value = scoreExplanation.Value;
string field = ((SpanQuery)Query).Field;
// now the payloads part
Explanation payloadExpl = OuterInstance.Function.Explain(doc, field, scorer.PayloadsSeen, scorer.PayloadScore);
// combined
ComplexExplanation result = new ComplexExplanation();
result.AddDetail(expl);
result.AddDetail(payloadExpl);
result.Value = expl.Value * payloadExpl.Value;
result.Description = "PayloadNearQuery, product of:";
return result;
}
}
return new ComplexExplanation(false, 0.0f, "no matching term");
}
示例6: SetNextReader
public override FieldComparator SetNextReader(AtomicReaderContext context)
{
idIndex = FieldCache_Fields.DEFAULT.GetTermsIndex((AtomicReader)context.Reader(), Fieldname);
return this;
}