本文整理汇总了C#中Lucene.Net.Index.IndexReader.MaxDoc方法的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Net.Index.IndexReader.MaxDoc方法的具体用法?C# Lucene.Net.Index.IndexReader.MaxDoc怎么用?C# Lucene.Net.Index.IndexReader.MaxDoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.IndexReader
的用法示例。
在下文中一共展示了Lucene.Net.Index.IndexReader.MaxDoc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bits
public override System.Collections.BitArray Bits(IndexReader reader)
{
System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));
return bits;
}
示例2: Bits
public override System.Collections.BitArray Bits(IndexReader reader)
{
if (cache == null)
{
cache = new System.Collections.Hashtable();
}
lock (cache.SyncRoot)
{
// check cache
System.Collections.BitArray cached = (System.Collections.BitArray) cache[reader];
if (cached != null)
{
return cached;
}
}
System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));
lock (cache.SyncRoot)
{
// update cache
cache[reader] = bits;
}
return bits;
}
示例3: Bits
public override System.Collections.BitArray Bits(IndexReader reader)
{
System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
for (int increment = 0; doc >= bits.Length; increment =+ 64)
{
bits.Length += increment;
}
bits.Set(doc, true);
return bits;
}
示例4: Bits
/// <summary> Returns a BitSet with true for documents which should be
/// permitted in search results, and false for those that should
/// not.
/// </summary>
/// <deprecated> Use {@link #GetDocIdSet(IndexReader)} instead.
/// </deprecated>
//@Override
public override System.Collections.BitArray Bits(IndexReader reader)
{
TermEnum enumerator = query.GetEnum(reader);
try
{
System.Collections.BitArray bitSet = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
new AnonymousClassTermGenerator(bitSet, this).Generate(query, reader, enumerator);
return bitSet;
}
finally
{
enumerator.Close();
}
}
示例5: CreateValue
protected internal override System.Object CreateValue(IndexReader reader, System.Object entryKey)
{
Entry entry = (Entry) entryKey;
System.String field = entry.field;
LongParser parser = (LongParser) entry.custom;
long[] retArray = new long[reader.MaxDoc()];
TermDocs termDocs = reader.TermDocs();
TermEnum termEnum = reader.Terms(new Term(field, ""));
try
{
do
{
Term term = termEnum.Term();
if (term == null || (System.Object) term.Field() != (System.Object) field)
break;
long termval = parser.ParseLong(term.Text());
termDocs.Seek(termEnum);
while (termDocs.Next())
{
retArray[termDocs.Doc()] = termval;
}
}
while (termEnum.Next());
}
finally
{
termDocs.Close();
termEnum.Close();
}
return retArray;
}
示例6: MatchAllScorer
internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity) : base(similarity)
{
InitBlock(enclosingInstance);
this.reader = reader;
count = - 1;
maxDoc = reader.MaxDoc();
}
示例7: MatchAllScorer
internal MatchAllScorer(MatchAllDocsQuery enclosingInstance, IndexReader reader, Similarity similarity, Weight w):base(similarity)
{
InitBlock(enclosingInstance);
this.reader = reader;
id = - 1;
maxId = reader.MaxDoc() - 1;
score = w.GetValue();
}
示例8: BitSpans
public override SpanFilterResult BitSpans(IndexReader reader)
{
OpenBitSet bits = new OpenBitSet((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
_Spans spans = query.GetSpans(reader);
System.Collections.IList tmp = new System.Collections.ArrayList(20);
int currentDoc = - 1;
SpanFilterResult.PositionInfo currentInfo = null;
while (spans.Next())
{
int doc = spans.Doc();
bits.Set(doc);
if (currentDoc != doc)
{
currentInfo = new SpanFilterResult.PositionInfo(doc);
tmp.Add(currentInfo);
currentDoc = doc;
}
currentInfo.AddPosition(spans.Start(), spans.End());
}
return new SpanFilterResult(bits, tmp);
}
示例9: BitSpans
public override SpanFilterResult BitSpans(IndexReader reader)
{
OpenBitSet bits = new OpenBitSet(reader.MaxDoc());
Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
List<SpanFilterResult.PositionInfo> tmp = new List<SpanFilterResult.PositionInfo>(20);
int currentDoc = - 1;
SpanFilterResult.PositionInfo currentInfo = null;
while (spans.Next())
{
int doc = spans.Doc();
bits.Set(doc);
if (currentDoc != doc)
{
currentInfo = new SpanFilterResult.PositionInfo(doc);
tmp.Add(currentInfo);
currentDoc = doc;
}
currentInfo.AddPosition(spans.Start(), spans.End());
}
return new SpanFilterResult(bits, tmp);
}
示例10: GetDocIdSet
public override DocIdSet GetDocIdSet(IndexReader reader)
{
System.Collections.BitArray bs = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
for (int i = 0; i < reader.MaxDoc(); i++) bs.Set(i, true);
bs.Set(docs1.ScoreDocs[0].Doc, true);
return new DocIdBitSet(bs);
}
示例11: Bits
public override System.Collections.BitArray Bits(IndexReader reader)
{
System.Collections.BitArray bitSet = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);
new AnonymousClassPrefixGenerator(bitSet, this, prefix).Generate(reader);
return bitSet;
}
示例12: ValueSourceScorer
// constructor
internal ValueSourceScorer(ValueSourceQuery enclosingInstance, Similarity similarity, IndexReader reader, ValueSourceWeight w)
: base(similarity)
{
InitBlock(enclosingInstance);
this.weight = w;
this.qWeight = w.GetValue();
this.reader = reader;
this.maxDoc = reader.MaxDoc();
// this is when/where the values are first created.
vals = Enclosing_Instance.valSrc.GetValues(reader);
}
示例13: Bits
public override System.Collections.BitArray Bits(IndexReader r)
{
System.Collections.BitArray b = new System.Collections.BitArray((r.MaxDoc() % 64 == 0?r.MaxDoc() / 64:r.MaxDoc() / 64 + 1) * 64);
for (int i = 0; i < docs.Length; i++)
{
b.Set(docs[i], true);
}
return b;
}
示例14: GetDocIdSet
public override DocIdSet GetDocIdSet(IndexReader reader)
{
OpenBitSet bitSet = new OpenBitSet((reader.MaxDoc() % 64 == 0 ? reader.MaxDoc() / 64 : reader.MaxDoc() / 64 + 1) * 64);
new AnonymousClassPrefixGenerator2(bitSet, this, prefix).Generate(reader);
return bitSet;
}
示例15: CreateValue
protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
{
System.String field = StringHelper.Intern((System.String) entryKey.field);
System.String[] retArray = new System.String[reader.MaxDoc()];
TermDocs termDocs = reader.TermDocs();
TermEnum termEnum = reader.Terms(new Term(field));
try
{
do
{
Term term = termEnum.Term();
if (term == null || (System.Object) term.Field() != (System.Object) field)
break;
System.String termval = term.Text();
termDocs.Seek(termEnum);
while (termDocs.Next())
{
retArray[termDocs.Doc()] = termval;
}
}
while (termEnum.Next());
}
finally
{
termDocs.Close();
termEnum.Close();
}
return retArray;
}