public class IntersectBlockReader extends BlockReader
TermsEnum response to UniformSplitTerms.intersect(CompiledAutomaton, BytesRef),
intersecting the terms with an automaton.| Modifier and Type | Class and Description |
|---|---|
protected static class |
IntersectBlockReader.AutomatonNextTermCalculator
This is a copy of AutomatonTermsEnum.
|
TermsEnum.SeekStatus| Modifier and Type | Field and Description |
|---|---|
protected boolean |
beyondCommonPrefix
Whether the current term is beyond the automaton common prefix.
|
protected int |
blockPrefixLen |
protected int |
blockPrefixRunAutomatonState |
protected BytesRef |
commonPrefixRef |
protected BytesRef |
commonSuffixRef |
protected IntersectBlockReader.AutomatonNextTermCalculator |
nextStringCalculator |
protected int |
numBytesAccepted
Number of bytes accepted by the last call to
runAutomatonForState(byte[], int, int, int). |
protected ByteRunAutomaton |
runAutomaton |
protected BytesRef |
seekTerm
Set this when our current mode is seeking to this term.
|
protected BytesRef |
startTerm |
blockDecoder, blockFirstLineStart, blockHeader, blockInput, blockLine, blockLineReader, blockReadBuffer, blockStartFP, dictionaryBrowser, dictionaryBrowserSupplier, fieldMetadata, forcedTerm, lineIndexInBlock, postingsReader, scratchBlockBytes, scratchTermState, termState, termStateForced, termStateSerializer, termStatesReadBuffer| Constructor and Description |
|---|
IntersectBlockReader(CompiledAutomaton compiled,
BytesRef startTerm,
DictionaryBrowserSupplier dictionaryBrowserSupplier,
IndexInput blockInput,
PostingsReaderBase postingsReader,
FieldMetadata fieldMetadata,
BlockDecoder blockDecoder) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isBeyondCommonPrefix(BytesRef bytesRef)
Determines if the provided
BytesRef is beyond the automaton common prefix. |
BytesRef |
next() |
protected boolean |
nextBlockMatchingPrefix()
Find the next block that appears to contain terms that could match the automata.
|
protected BytesRef |
nextTermInBlockMatching()
Find the next block line that matches, or null when at end of block.
|
protected int |
runAutomatonForState(byte[] s,
int offset,
int length,
int initialState)
Run the automaton and return the final state (not necessary accepted).
|
protected boolean |
runAutomatonFromPrefix(BytesRef term) |
TermsEnum.SeekStatus |
seekCeil(BytesRef text) |
boolean |
seekExact(BytesRef text) |
void |
seekExact(BytesRef term,
TermState state)
Positions this
BlockReader without re-seeking the term dictionary. |
void |
seekExact(long ord)
Not supported.
|
clearTermState, compareToMiddleAndJump, decodeBlockBytesIfNeeded, docFreq, getOrCreateDictionaryBrowser, impacts, initializeBlockReadLazily, initializeHeader, isBeyondLastTerm, isCurrentTerm, nextTerm, ord, postings, ramBytesUsed, readHeader, readLineInBlock, readTermState, readTermStateIfNotRead, seekInBlock, seekInBlock, term, termState, totalTermFreqattributesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildResourcesprotected final IntersectBlockReader.AutomatonNextTermCalculator nextStringCalculator
protected final ByteRunAutomaton runAutomaton
protected final BytesRef commonSuffixRef
protected final BytesRef commonPrefixRef
protected final BytesRef startTerm
protected BytesRef seekTerm
protected int blockPrefixRunAutomatonState
protected int blockPrefixLen
protected int numBytesAccepted
runAutomatonForState(byte[], int, int, int).protected boolean beyondCommonPrefix
public IntersectBlockReader(CompiledAutomaton compiled, BytesRef startTerm, DictionaryBrowserSupplier dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder) throws IOException
IOExceptionpublic BytesRef next() throws IOException
next in interface BytesRefIteratornext in class BlockReaderIOExceptionprotected boolean nextBlockMatchingPrefix()
throws IOException
IOExceptionprotected BytesRef nextTermInBlockMatching() throws IOException
IOExceptionprotected boolean runAutomatonFromPrefix(BytesRef term)
protected int runAutomatonForState(byte[] s,
int offset,
int length,
int initialState)
numBytesAccepted with the offset of the first byte rejected by the automaton;
or (offset + length) if no byte is rejected.protected boolean isBeyondCommonPrefix(BytesRef bytesRef)
BytesRef is beyond the automaton common prefix.
This method must be called after a call to runAutomatonForState(byte[], int, int, int) because
it uses numBytesAccepted value.public boolean seekExact(BytesRef text)
seekExact in class BlockReaderpublic void seekExact(long ord)
BlockReaderseekExact in class BlockReaderpublic TermsEnum.SeekStatus seekCeil(BytesRef text)
seekCeil in class BlockReaderpublic void seekExact(BytesRef term, TermState state)
BlockReaderBlockReader 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.
Calling BlockReader.postings(org.apache.lucene.index.PostingsEnum, int) after this method does require the block to be read.
seekExact in class BlockReaderCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.