CompletionTerms (Lucene 10.5.0 suggest API)
Description: declaration: package: org.apache.lucene.search.suggest.document, class: CompletionTerms

Package org.apache.lucene.search.suggest.document

# Class CompletionTerms

java.lang.Object
org.apache.lucene.index.Terms
org.apache.lucene.index.FilterLeafReader.FilterTerms
org.apache.lucene.search.suggest.document.CompletionTerms

public final class CompletionTerms extends FilterLeafReader.FilterTerms
Wrapped `Terms` used by `SuggestField` and `ContextSuggestField` to access corresponding suggester and their attributes

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

- ## Field Summary

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

  `in`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getMaxWeight()`
  Returns the maximum weight of all entries in the weighted FST
  `long`
  `getMinWeight()`
  Returns the minimum weight of all entries in the weighted FST
  `byte`
  `getType()`
  Returns the type of FST, either `SuggestField.TYPE` or `ContextSuggestField.TYPE`
  `NRTSuggester`
  `suggester()`
  Returns a `NRTSuggester` for the field or `null` if no FST was indexed for this field

  ### Methods inherited from class org.apache.lucene.index.FilterLeafReader.FilterTerms

  `getDocCount, getStats, getSumDocFreq, getSumTotalTermFreq, hasFreqs, hasOffsets, hasPayloads, hasPositions, iterator, size`

  ### Methods inherited from class org.apache.lucene.index.Terms

  `getMax, getMin, getTerms, intersect`

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

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

- ## Method Details

  - ### getType

    public byte getType()
    Returns the type of FST, either `SuggestField.TYPE` or `ContextSuggestField.TYPE`

  - ### getMinWeight

    public long getMinWeight()
    Returns the minimum weight of all entries in the weighted FST

  - ### getMaxWeight

    public long getMaxWeight()
    Returns the maximum weight of all entries in the weighted FST

  - ### suggester

    public NRTSuggester suggester() throws IOException
    Returns a `NRTSuggester` for the field or `null` if no FST was indexed for this field
    Throws:
      `IOException`