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
Iterates through the documents and term freqs.
NOTE: you must first call
DocIdSetIterator.nextDoc()
before using
any of the per-doc methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Flag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you require term frequencies in the returned enum.static final int
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 -
Method Summary
Modifier and TypeMethodDescriptionReturns 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 Details
-
FLAG_NONE
public static final int FLAG_NONEFlag 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:
-
FLAG_FREQS
public static final int FLAG_FREQSFlag to pass toTermsEnum.docs(Bits,DocsEnum,int)
if you require term frequencies in the returned enum.- See Also:
-
-
Constructor Details
-
DocsEnum
protected DocsEnum()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
freq
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
Returns the related attributes.
-