Class IDVersionSegmentTermsEnum
- java.lang.Object
-
- org.apache.lucene.index.TermsEnum
-
- org.apache.lucene.index.BaseTermsEnum
-
- org.apache.lucene.sandbox.codecs.idversion.IDVersionSegmentTermsEnum
-
- All Implemented Interfaces:
BytesRefIterator
public final class IDVersionSegmentTermsEnum extends BaseTermsEnum
Iterates through terms in this field; this class is public so users can cast it to callseekExact(BytesRef, long)for optimistic-concurrency, and alsogetVersion()to get the version of the currently seek'd term.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum
TermsEnum.SeekStatus
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdocFreq()longgetVersion()Get the version of the currently seek'd term; only valid if we are positioned.ImpactsEnumimpacts(int flags)BytesRefnext()longord()PostingsEnumpostings(PostingsEnum reuse, int flags)TermsEnum.SeekStatusseekCeil(BytesRef target)voidseekExact(long ord)booleanseekExact(BytesRef target)booleanseekExact(BytesRef target, long minIDVersion)Optimized version ofseekExact(BytesRef)that can sometimes fail-fast if the version indexed with the requested ID is less than the specified minIDVersion.voidseekExact(BytesRef target, TermState otherState)BytesRefterm()TermStatetermState()StringtoString()longtotalTermFreq()-
Methods inherited from class org.apache.lucene.index.BaseTermsEnum
attributes
-
-
-
-
Method Detail
-
seekExact
public boolean seekExact(BytesRef target) throws IOException
- Overrides:
seekExactin classBaseTermsEnum- Throws:
IOException
-
getVersion
public long getVersion()
Get the version of the currently seek'd term; only valid if we are positioned.
-
seekExact
public boolean seekExact(BytesRef target, long minIDVersion) throws IOException
Optimized version ofseekExact(BytesRef)that can sometimes fail-fast if the version indexed with the requested ID is less than the specified minIDVersion. Applications that index a monotonically increasing global version with each document can use this for fast optimistic concurrency.- Throws:
IOException
-
seekCeil
public TermsEnum.SeekStatus seekCeil(BytesRef target) throws IOException
- Specified by:
seekCeilin classTermsEnum- Throws:
IOException
-
next
public BytesRef next() throws IOException
- Throws:
IOException
-
docFreq
public int docFreq() throws IOException- Specified by:
docFreqin classTermsEnum- Throws:
IOException
-
totalTermFreq
public long totalTermFreq() throws IOException- Specified by:
totalTermFreqin classTermsEnum- Throws:
IOException
-
postings
public PostingsEnum postings(PostingsEnum reuse, int flags) throws IOException
- Specified by:
postingsin classTermsEnum- Throws:
IOException
-
impacts
public ImpactsEnum impacts(int flags) throws IOException
- Specified by:
impactsin classTermsEnum- Throws:
IOException
-
seekExact
public void seekExact(BytesRef target, TermState otherState)
- Overrides:
seekExactin classBaseTermsEnum
-
termState
public TermState termState() throws IOException
- Overrides:
termStatein classBaseTermsEnum- Throws:
IOException
-
-