Package org.apache.lucene.index
Class DocsEnum
- java.lang.Object
-
- org.apache.lucene.search.DocIdSetIterator
-
- org.apache.lucene.index.DocsEnum
-
- Direct Known Subclasses:
DocsAndPositionsEnum
,FilterAtomicReader.FilterDocsEnum
,MappingMultiDocsEnum
,MultiDocsEnum
,Scorer
public abstract class DocsEnum extends DocIdSetIterator
Iterates through the documents and term freqs. NOTE: you must first callDocIdSetIterator.nextDoc()
before using any of the per-doc methods.
-
-
Field Summary
Fields Modifier and Type Field Description static int
FLAG_FREQS
Flag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you require term frequencies in the returned enum.static int
FLAG_NONE
Flag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you don't require term frequencies in the returned enum.-
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DocsEnum()
Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AttributeSource
attributes()
Returns the related attributes.abstract int
freq()
Returns term frequency in the current document, or 1 if the field was indexed withFieldInfo.IndexOptions.DOCS_ONLY
.-
Methods inherited from class org.apache.lucene.search.DocIdSetIterator
advance, cost, docID, empty, nextDoc, slowAdvance
-
-
-
-
Field Detail
-
FLAG_NONE
public static final int FLAG_NONE
Flag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you don't require term frequencies in the returned enum. When passed toTermsEnum.docsAndPositions(Bits,DocsAndPositionsEnum,int)
means that no offsets and payloads will be returned.- See Also:
- Constant Field Values
-
FLAG_FREQS
public static final int FLAG_FREQS
Flag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you require term frequencies in the returned enum.- See Also:
- Constant Field Values
-
-
Method Detail
-
freq
public abstract int freq() throws IOException
Returns term frequency in the current document, or 1 if the field was indexed withFieldInfo.IndexOptions.DOCS_ONLY
. Do not call this beforeDocIdSetIterator.nextDoc()
is first called, nor afterDocIdSetIterator.nextDoc()
returnsDocIdSetIterator.NO_MORE_DOCS
.NOTE: if the
DocsEnum
was obtain withFLAG_NONE
, the result of this method is undefined.- Throws:
IOException
-
attributes
public AttributeSource attributes()
Returns the related attributes.
-
-