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, totalTermFreq
attributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
protected 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
IOException
public BytesRef next() throws IOException
next
in interface BytesRefIterator
next
in class BlockReader
IOException
protected boolean nextBlockMatchingPrefix() throws IOException
IOException
protected BytesRef nextTermInBlockMatching() throws IOException
IOException
protected 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 BlockReader
public void seekExact(long ord)
BlockReader
seekExact
in class BlockReader
public TermsEnum.SeekStatus seekCeil(BytesRef text)
seekCeil
in class BlockReader
public void seekExact(BytesRef term, TermState state)
BlockReader
BlockReader
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 BlockReader
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.