public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs) { SortedDocValues fcsi = FieldCache.GetTermsIndex((context.AtomicReader), field); FixedBitSet bits = new FixedBitSet(fcsi.ValueCount); for (int i = 0; i < terms.Length; i++) { int ord = fcsi.LookupTerm(terms[i]); if (ord >= 0) { bits.Set(ord); } } return(new FieldCacheDocIdSet(context.Reader.MaxDoc, acceptDocs, (doc) => { int ord = fcsi.GetOrd(doc); if (ord == -1) { // missing return false; } else { return bits.Get(ord); } })); }
protected internal override sealed bool MatchDoc(int doc) { int ord = fcsi.GetOrd(doc); if (ord == -1) { // missing return(false); } else { return(bits.Get(ord)); } }
public virtual bool Get(int index) { return(dv.GetOrd(index) >= 0); }
// detects and corrects LUCENE-4717 in old indexes private SortedDocValues CorrectBuggyOrds(SortedDocValues @in) { int maxDoc = State.SegmentInfo.DocCount; for (int i = 0; i < maxDoc; i++) { if (@in.GetOrd(i) == 0) { return @in; // ok } } // we had ord holes, return an ord-shifting-impl that corrects the bug return new SortedDocValuesAnonymousInnerClassHelper3(@in); }