Package org.apache.lucene.backward_codecs.lucene90.blocktree

# Class Lucene90BlockTreeTermsReader

java.lang.Object
org.apache.lucene.index.Fields
org.apache.lucene.codecs.FieldsProducer
org.apache.lucene.backward_codecs.lucene90.blocktree.Lucene90BlockTreeTermsReader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Iterable<String>`

public final class Lucene90BlockTreeTermsReader extends FieldsProducer
A block-based terms index and dictionary that assigns terms to variable length blocks according to how they share prefixes. The terms index is a prefix trie whose leaves are term blocks. The advantage of this approach is that seekExact is often able to determine a term cannot exist without doing any IO, and intersection with Automata is very fast. Note that this terms dictionary has its own fixed terms index (ie, it does not support a pluggable terms index implementation).

NOTE: this terms dictionary supports min/maxItemsPerBlock during indexing to control how much memory the terms index uses.

The data structure used by this implementation is very similar to a burst trie (http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499), but with added logic to break up too-large blocks of all terms sharing a given prefix into smaller ones.

Use `CheckIndex` with the `-verbose` option to see summary statistics on the blocks in the dictionary.

See Lucene90BlockTreeTermsWriter.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `TERMS_CODEC_NAME`
  Extension of terms codec name
  `static final String`
  `TERMS_EXTENSION`
  Extension of terms file
  `static final String`
  `TERMS_INDEX_CODEC_NAME`
  Extension of terms index codec name
  `static final String`
  `TERMS_INDEX_EXTENSION`
  Extension of terms index file
  `static final String`
  `TERMS_META_CODEC_NAME`
  Extension of terms meta codec name
  `static final String`
  `TERMS_META_EXTENSION`
  Extension of terms meta file
  `static final int`
  `VERSION_CURRENT`
  Current terms format.
  `static final int`
  `VERSION_FST_CONTINUOUS_ARCS`
  The version that specialize arc store for continuous label in FST.
  `static final int`
  `VERSION_MSB_VLONG_OUTPUT`
  Version that encode output as MSB VLong for better outputs sharing in FST, see GITHUB#12620.
  `static final int`
  `VERSION_START`
  Initial terms format.

  ### Fields inherited from class org.apache.lucene.index.Fields

  `EMPTY_ARRAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Lucene90BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state)`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkIntegrity()`
  `void`
  `close()`
  `Iterator<String>`
  `iterator()`
  `int`
  `size()`
  `Terms`
  `terms(String field)`
  `String`
  `toString()`

  ### Methods inherited from class org.apache.lucene.codecs.FieldsProducer

  `getMergeInstance`

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Field Details

  - ### TERMS_EXTENSION

    public static final String TERMS_EXTENSION
    Extension of terms file
    See Also:
      - Constant Field Values

  - ### TERMS_CODEC_NAME

    public static final String TERMS_CODEC_NAME
    Extension of terms codec name
    See Also:
      - Constant Field Values

  - ### VERSION_START

    public static final int VERSION_START
    Initial terms format.
    See Also:
      - Constant Field Values

  - ### VERSION_MSB_VLONG_OUTPUT

    public static final int VERSION_MSB_VLONG_OUTPUT
    Version that encode output as MSB VLong for better outputs sharing in FST, see GITHUB#12620.
    See Also:
      - Constant Field Values

  - ### VERSION_FST_CONTINUOUS_ARCS

    public static final int VERSION_FST_CONTINUOUS_ARCS
    The version that specialize arc store for continuous label in FST.
    See Also:
      - Constant Field Values

  - ### VERSION_CURRENT

    public static final int VERSION_CURRENT
    Current terms format.
    See Also:
      - Constant Field Values

  - ### TERMS_INDEX_EXTENSION

    public static final String TERMS_INDEX_EXTENSION
    Extension of terms index file
    See Also:
      - Constant Field Values

  - ### TERMS_INDEX_CODEC_NAME

    public static final String TERMS_INDEX_CODEC_NAME
    Extension of terms index codec name
    See Also:
      - Constant Field Values

  - ### TERMS_META_EXTENSION

    public static final String TERMS_META_EXTENSION
    Extension of terms meta file
    See Also:
      - Constant Field Values

  - ### TERMS_META_CODEC_NAME

    public static final String TERMS_META_CODEC_NAME
    Extension of terms meta codec name
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Lucene90BlockTreeTermsReader

    public Lucene90BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state) throws IOException
    Sole constructor.
    Throws:
      `IOException`

- ## Method Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Specified by:
      `close` in class `FieldsProducer`
    Throws:
      `IOException`

  - ### iterator

    public Iterator<String> iterator()
    Specified by:
      `iterator` in interface `Iterable<String>`
    Specified by:
      `iterator` in class `Fields`

  - ### terms

    public Terms terms(String field) throws IOException
    Specified by:
      `terms` in class `Fields`
    Throws:
      `IOException`

  - ### size

    public int size()
    Specified by:
      `size` in class `Fields`

  - ### checkIntegrity

    public void checkIntegrity() throws IOException
    Specified by:
      `checkIntegrity` in class `FieldsProducer`
    Throws:
      `IOException`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`