本文整理汇总了C#中Mono.Lucene.Net.Index.IndexReader.TermDocs方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.Lucene.Net.Index.IndexReader.TermDocs方法的具体用法?C# Mono.Lucene.Net.Index.IndexReader.TermDocs怎么用?C# Mono.Lucene.Net.Index.IndexReader.TermDocs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Lucene.Net.Index.IndexReader
的用法示例。
在下文中一共展示了Mono.Lucene.Net.Index.IndexReader.TermDocs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchAllScorer
internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity, Weight w, byte[] norms):base(similarity)
{
InitBlock(enclosingInstance);
this.termDocs = reader.TermDocs(null);
score = w.GetValue();
this.norms = norms;
}
示例2: Scorer
public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer)
{
TermDocs termDocs = reader.TermDocs(Enclosing_Instance.term);
if (termDocs == null)
return null;
return new TermScorer(this, termDocs, similarity, reader.Norms(Enclosing_Instance.term.Field()));
}
示例3: Generate
public virtual void Generate(MultiTermQuery query, IndexReader reader, TermEnum enumerator)
{
int[] docs = new int[32];
int[] freqs = new int[32];
TermDocs termDocs = reader.TermDocs();
try
{
int termCount = 0;
do
{
Term term = enumerator.Term();
if (term == null)
break;
termCount++;
termDocs.Seek(term);
while (true)
{
int count = termDocs.Read(docs, freqs);
if (count != 0)
{
for (int i = 0; i < count; i++)
{
HandleDoc(docs[i]);
}
}
else
{
break;
}
}
}
while (enumerator.Next());
query.IncTotalNumberOfTerms(termCount); // {{Aroush-2.9}} is the use of 'temp' as is right?
}
finally
{
termDocs.Close();
}
}
示例4: ValueSourceScorer
// constructor
internal ValueSourceScorer(ValueSourceQuery enclosingInstance, Similarity similarity, IndexReader reader, ValueSourceWeight w):base(similarity)
{
InitBlock(enclosingInstance);
this.weight = w;
this.qWeight = w.GetValue();
// this is when/where the values are first created.
vals = Enclosing_Instance.valSrc.GetValues(reader);
termDocs = reader.TermDocs(null);
}
示例5: CreateValue
protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
{
System.String field = StringHelper.Intern((System.String) entryKey.field);
int[] retArray = new int[reader.MaxDoc()];
System.String[] mterms = new System.String[reader.MaxDoc() + 1];
TermDocs termDocs = reader.TermDocs();
TermEnum termEnum = reader.Terms(new Term(field));
int t = 0; // current term number
// an entry for documents that have no terms in this field
// should a document with no terms be at top or bottom?
// this puts them at the top - if it is changed, FieldDocSortedHitQueue
// needs to change as well.
mterms[t++] = null;
try
{
do
{
Term term = termEnum.Term();
if (term == null || term.Field() != field || t >= mterms.Length) break;
// store term text
mterms[t] = term.Text();
termDocs.Seek(termEnum);
while (termDocs.Next())
{
retArray[termDocs.Doc()] = t;
}
t++;
}
while (termEnum.Next());
}
finally
{
termDocs.Close();
termEnum.Close();
}
if (t == 0)
{
// if there are no terms, make the term array
// have a single null entry
mterms = new System.String[1];
}
else if (t < mterms.Length)
{
// if there are less terms than documents,
// trim off the dead array space
System.String[] terms = new System.String[t];
Array.Copy(mterms, 0, terms, 0, t);
mterms = terms;
}
StringIndex value_Renamed = new StringIndex(retArray, mterms);
return value_Renamed;
}