Class IntersectBlockReader

    • Field Detail

      • commonSuffixRef

        protected final BytesRef commonSuffixRef
      • commonPrefixRef

        protected final BytesRef commonPrefixRef
      • startTerm

        protected final BytesRef startTerm
      • seekTerm

        protected BytesRef seekTerm
        Set this when our current mode is seeking to this term. Set to null after.
      • blockPrefixRunAutomatonState

        protected int blockPrefixRunAutomatonState
      • blockPrefixLen

        protected int blockPrefixLen
      • beyondCommonPrefix

        protected boolean beyondCommonPrefix
        Whether the current term is beyond the automaton common prefix. If true this means the enumeration should stop immediately.
    • Method Detail

      • next

        public BytesRef next()
                      throws java.io.IOException
        Description copied from interface: BytesRefIterator
        Increments the iteration to the next BytesRef in the iterator. Returns the resulting BytesRef or null 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 interface BytesRefIterator
        Overrides:
        next in class BlockReader
        Returns:
        the next BytesRef in the iterator or null if the end of the iterator is reached.
        Throws:
        java.io.IOException - If there is a low-level I/O error.
      • nextBlockMatchingPrefix

        protected boolean nextBlockMatchingPrefix()
                                           throws java.io.IOException
        Find the next block that appears to contain terms that could match the automata. The prefix is the primary clue. Returns true if at one, or false for no more (EOF).
        Throws:
        java.io.IOException
      • nextTermInBlockMatching

        protected BytesRef nextTermInBlockMatching()
                                            throws java.io.IOException
        Find the next block line that matches, or null when at end of block.
        Throws:
        java.io.IOException
      • runAutomatonFromPrefix

        protected boolean runAutomatonFromPrefix​(BytesRef term)
      • runAutomatonForState

        protected int runAutomatonForState​(byte[] s,
                                           int offset,
                                           int length,
                                           int initialState)
        Run the automaton and return the final state (not necessary accepted). -1 signifies no state / no match. Sets numBytesAccepted with the offset of the first byte rejected by the automaton; or (offset + length) if no byte is rejected.
      • seekExact

        public boolean seekExact​(BytesRef text)
        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 than TermsEnum.seekCeil(org.apache.lucene.util.BytesRef).

        Overrides:
        seekExact in class BlockReader
        Returns:
        true if the term is found; return false if the enum is unpositioned.
      • seekCeil

        public TermsEnum.SeekStatus seekCeil​(BytesRef text)
        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 class BlockReader