protected override bool UseRandomAccess(Bits bits, int firstFilterDoc) { return true; }
public override DocsAndPositionsEnum DocsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse, int flags) { throw new System.NotSupportedException(); }
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { bool nullBitset = Random().Next(10) == 5; AtomicReader reader = context.AtomicReader; DocsEnum termDocsEnum = reader.TermDocsEnum(new Term("field", "0")); if (termDocsEnum == null) { return null; // no docs -- return null } BitArray bitSet = new BitArray(reader.MaxDoc); int d; while ((d = termDocsEnum.NextDoc()) != DocsEnum.NO_MORE_DOCS) { bitSet.SafeSet(d, true); } return new DocIdSetAnonymousInnerClassHelper(this, nullBitset, reader, bitSet); }
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { return new DocIdSetAnonymousInnerClassHelper2(this, context); }
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { if (acceptDocs == null) { acceptDocs = new Bits_MatchAllBits(5); } BitArray bitset = new BitArray(5); if (acceptDocs.Get(1)) { bitset.SafeSet(1, true); } if (acceptDocs.Get(3)) { bitset.SafeSet(3, true); } return new DocIdBitSet(bitset); }
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs) { Assert.IsNull(acceptDocs, "acceptDocs should be null, as we have an index without deletions"); BitArray bitset = new BitArray(5, true); return new DocIdBitSet(bitset); }
public override DocsAndPositionsEnum DocsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse, int flags) { throw new InvalidOperationException("this method should never be called"); }
/// <summary> /// Get <seealso cref="DocsAndPositionsEnum"/> for the current term, /// with control over whether offsets and payloads are /// required. Some codecs may be able to optimize their /// implementation when offsets and/or payloads are not required. /// Do not call this when the enum is unpositioned. this /// will return null if positions were not indexed. /// </summary> /// <param name="liveDocs"> unset bits are documents that should not /// be returned </param> /// <param name="reuse"> pass a prior DocsAndPositionsEnum for possible reuse </param> /// <param name="flags"> specifies which optional per-position values you /// require; see <seealso cref="DocsAndPositionsEnum#FLAG_OFFSETS"/> and /// <seealso cref="DocsAndPositionsEnum#FLAG_PAYLOADS"/>. </param> public abstract DocsAndPositionsEnum DocsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse, int flags);
/// <summary> /// Get <seealso cref="DocsAndPositionsEnum"/> for the current term. /// Do not call this when the enum is unpositioned. this /// method will return null if positions were not /// indexed. /// </summary> /// <param name="liveDocs"> unset bits are documents that should not /// be returned </param> /// <param name="reuse"> pass a prior DocsAndPositionsEnum for possible reuse </param> /// <seealso cref= #docsAndPositions(Bits, DocsAndPositionsEnum, int) </seealso> public DocsAndPositionsEnum DocsAndPositions(Bits liveDocs, DocsAndPositionsEnum reuse) { return DocsAndPositions(liveDocs, reuse, DocsAndPositionsEnum.FLAG_OFFSETS | DocsAndPositionsEnum.FLAG_PAYLOADS); }
/// <summary> /// Get <seealso cref="DocsEnum"/> for the current term, with /// control over whether freqs are required. Do not /// call this when the enum is unpositioned. this method /// will not return null. /// </summary> /// <param name="liveDocs"> unset bits are documents that should not /// be returned </param> /// <param name="reuse"> pass a prior DocsEnum for possible reuse </param> /// <param name="flags"> specifies which optional per-document values /// you require; see <seealso cref="DocsEnum#FLAG_FREQS"/> </param> /// <seealso cref= #docs(Bits, DocsEnum, int) </seealso> public abstract DocsEnum Docs(Bits liveDocs, DocsEnum reuse, int flags);
/// <summary> /// Get <seealso cref="DocsEnum"/> for the current term. Do not /// call this when the enum is unpositioned. this method /// will not return null. /// </summary> /// <param name="liveDocs"> unset bits are documents that should not /// be returned </param> /// <param name="reuse"> pass a prior DocsEnum for possible reuse </param> public DocsEnum Docs(Bits liveDocs, DocsEnum reuse) { return Docs(liveDocs, reuse, DocsEnum.FLAG_FREQS); }