org.apache.lucene.codecs.blockterms

## Class FixedGapTermsIndexWriter

- java.lang.Object
- - org.apache.lucene.codecs.blockterms.TermsIndexWriterBase
  - - org.apache.lucene.codecs.blockterms.FixedGapTermsIndexWriter

- All Implemented Interfaces:
    Closeable, 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.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.codecs.blockterms.TermsIndexWriterBase

      `TermsIndexWriterBase.FieldWriter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_TERM_INDEX_INTERVAL`
    `protected IndexOutput` | `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixedGapTermsIndexWriter(SegmentWriteState state)`
    `FixedGapTermsIndexWriter(SegmentWriteState state, int termIndexInterval)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TermsIndexWriterBase.FieldWriter` | `addField(FieldInfo field, long termsFilePointer)`
    `void` | `close()`
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### out

          protected IndexOutput out

    - #### DEFAULT_TERM_INDEX_INTERVAL

          public static final int DEFAULT_TERM_INDEX_INTERVAL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FixedGapTermsIndexWriter

          public FixedGapTermsIndexWriter(SegmentWriteState state)
                                   throws IOException

      Throws:
        `IOException`

    - #### FixedGapTermsIndexWriter

          public FixedGapTermsIndexWriter(SegmentWriteState state,
                                          int termIndexInterval)
                                   throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### addField

          public TermsIndexWriterBase.FieldWriter addField(FieldInfo field,
                                                           long termsFilePointer)

      Specified by:
        `addField` in class `TermsIndexWriterBase`

    - #### 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 IOException

      Throws:
        `IOException`

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.