Class STMergingBlockReader
- java.lang.Object
-
- org.apache.lucene.index.TermsEnum
-
- org.apache.lucene.index.BaseTermsEnum
-
- org.apache.lucene.codecs.uniformsplit.BlockReader
-
- org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader
-
- org.apache.lucene.codecs.uniformsplit.sharedterms.STMergingBlockReader
-
- All Implemented Interfaces:
Accountable
,BytesRefIterator
public class STMergingBlockReader extends STBlockReader
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum
TermsEnum.SeekStatus
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader
fieldInfos
-
Fields inherited from class org.apache.lucene.codecs.uniformsplit.BlockReader
blockDecoder, blockFirstLineStart, blockHeader, blockInput, blockLine, blockLineReader, blockReadBuffer, blockStartFP, dictionaryBrowser, dictionaryBrowserSupplier, fieldMetadata, forcedTerm, lineIndexInBlock, postingsReader, scratchBlockBytes, scratchTermState, termState, termStateForced, termStateSerializer, termStatesReadBuffer
-
-
Constructor Summary
Constructors Constructor Description STMergingBlockReader(java.util.function.Supplier<IndexDictionary.Browser> dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, FieldInfos fieldInfos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytesRef
next()
Increments the iteration to the nextBytesRef
in the iterator.PostingsEnum
postings(java.lang.String fieldName, BlockTermState termState, PostingsEnum reuse, int flags)
Creates a newPostingsEnum
for the provided field andBlockTermState
.void
readFieldTermStatesMap(java.util.Map<java.lang.String,BlockTermState> fieldTermStatesMap)
Reads all the fieldsTermState
s of the current term and put them in the provided map.protected BlockTermState
readTermStateIfNotRead()
Reads theBlockTermState
if it is not already set.TermsEnum.SeekStatus
seekCeil(BytesRef searchedTerm)
Seeks to the specified term, if it exists, or to the next (ceiling) term.void
seekExact(long ord)
Not supported.boolean
seekExact(BytesRef searchedTerm)
Attempts to seek to the exact term, returning true if the term is found.void
seekExact(BytesRef term, TermState state)
Positions thisBlockReader
without re-seeking the term dictionary.-
Methods inherited from class org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader
isBeyondLastTerm, nextTerm, readTermState, seekCeilIgnoreField
-
Methods inherited from class org.apache.lucene.codecs.uniformsplit.BlockReader
clearTermState, compareToMiddleAndJump, decodeBlockBytesIfNeeded, docFreq, getOrCreateDictionaryBrowser, impacts, initializeBlockReadLazily, initializeHeader, isCurrentTerm, ord, postings, ramBytesUsed, readHeader, readLineInBlock, seekInBlock, seekInBlock, term, termState, totalTermFreq
-
Methods inherited from class org.apache.lucene.index.BaseTermsEnum
attributes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Constructor Detail
-
STMergingBlockReader
public STMergingBlockReader(java.util.function.Supplier<IndexDictionary.Browser> dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, FieldInfos fieldInfos) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
seekCeil
public TermsEnum.SeekStatus seekCeil(BytesRef searchedTerm)
Description copied from class:TermsEnum
Seeks to the specified term, if it exists, or to the next (ceiling) term. Returns SeekStatus to indicate whether exact term was found, a different term was found, or EOF was hit. The target term may be before or after the current term. If this returns SeekStatus.END, the enum is unpositioned.- Overrides:
seekCeil
in classSTBlockReader
-
seekExact
public boolean seekExact(BytesRef searchedTerm)
Description copied from class:TermsEnum
Attempts to seek to the exact term, returning true if the term is found. If this returns false, the enum is unpositioned. For some codecs, seekExact may be substantially faster thanTermsEnum.seekCeil(org.apache.lucene.util.BytesRef)
.- Overrides:
seekExact
in classSTBlockReader
- Returns:
- true if the term is found; return false if the enum is unpositioned.
-
seekExact
public void seekExact(BytesRef term, TermState state)
Description copied from class:BlockReader
Positions thisBlockReader
without re-seeking the term dictionary.The block containing the term is not read by this method. It will be read lazily only if needed, for example if
BlockReader.next()
is called. CallingBlockReader.postings(org.apache.lucene.index.PostingsEnum, int)
after this method does require the block to be read.- Overrides:
seekExact
in classBlockReader
- Parameters:
term
- the term the TermState corresponds tostate
- theTermState
-
seekExact
public void seekExact(long ord)
Description copied from class:BlockReader
Not supported.- Overrides:
seekExact
in classBlockReader
-
readTermStateIfNotRead
protected BlockTermState readTermStateIfNotRead()
Description copied from class:BlockReader
Reads theBlockTermState
if it is not already set. SetsBlockReader.termState
.- Overrides:
readTermStateIfNotRead
in classBlockReader
-
next
public BytesRef next() throws java.io.IOException
Description copied from interface:BytesRefIterator
Increments the iteration to the nextBytesRef
in the iterator. Returns the resultingBytesRef
ornull
if the end of the iterator is reached. The returned BytesRef may be re-used across calls to next. After this method returns null, do not call it again: the results are undefined.- Specified by:
next
in interfaceBytesRefIterator
- Overrides:
next
in classSTBlockReader
- Returns:
- the next
BytesRef
in the iterator ornull
if the end of the iterator is reached. - Throws:
java.io.IOException
- If there is a low-level I/O error.
-
postings
public PostingsEnum postings(java.lang.String fieldName, BlockTermState termState, PostingsEnum reuse, int flags) throws java.io.IOException
Creates a newPostingsEnum
for the provided field andBlockTermState
.- Parameters:
reuse
- PreviousPostingsEnum
to reuse; or null to create a new one.flags
- Postings flags.- Throws:
java.io.IOException
-
readFieldTermStatesMap
public void readFieldTermStatesMap(java.util.Map<java.lang.String,BlockTermState> fieldTermStatesMap) throws java.io.IOException
Reads all the fieldsTermState
s of the current term and put them in the provided map. Clears the map first, before puttingTermState
s.- Throws:
java.io.IOException
-
-