Class FixedGapTermsIndexWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class FixedGapTermsIndexWriter
    extends TermsIndexWriterBase
    Selects every Nth term as and index term, and hold term bytes (mostly) fully expanded in memory. This terms index supports seeking by ord. See VariableGapTermsIndexWriter for a more memory efficient terms index that does not support seeking by ord.
    • Constructor Detail

      • FixedGapTermsIndexWriter

        public FixedGapTermsIndexWriter​(SegmentWriteState state)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • FixedGapTermsIndexWriter

        public FixedGapTermsIndexWriter​(SegmentWriteState state,
                                        int termIndexInterval)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • indexedTermPrefixLength

        protected int indexedTermPrefixLength​(BytesRef priorTerm,
                                              BytesRef indexedTerm)
        NOTE: if your codec does not sort in unicode code point order, you must override this method, to simply return indexedTerm.length.
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTrailer

        private void writeTrailer​(long dirStart)
                           throws java.io.IOException
        Throws:
        java.io.IOException