InputIterator (Lucene 10.5.1 suggest API)
Description: declaration: package: org.apache.lucene.search.suggest, interface: InputIterator

Package org.apache.lucene.search.suggest

# Interface InputIterator

All Superinterfaces:
  `BytesRefIterator`

All Known Implementing Classes:
  `BufferedInputIterator`, `DocumentDictionary.DocumentInputIterator`, `InputIterator.InputIteratorWrapper`, `SortedInputIterator`, `UnsortedInputIterator`

public interface InputIterator extends BytesRefIterator
Interface for enumerating term,weight,payload triples for suggester consumption; currently only `AnalyzingSuggester`, `FuzzySuggester` and `AnalyzingInfixSuggester` support payloads.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static class`
  `InputIterator.InputIteratorWrapper`
  Wraps a BytesRefIterator as a suggester InputIterator, with all weights set to `1` and carries no payload

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final InputIterator`
  `EMPTY`
  Singleton InputIterator that iterates over 0 BytesRefs.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<BytesRef>`
  `contexts()`
  A term's contexts context can be used to filter suggestions.
  `boolean`
  `hasContexts()`
  Returns true if the iterator has contexts
  `boolean`
  `hasPayloads()`
  Returns true if the iterator has payloads
  `BytesRef`
  `payload()`
  An arbitrary byte[] to record per suggestion.
  `long`
  `weight()`
  A term's weight, higher numbers mean better suggestions.

  ### Methods inherited from interface org.apache.lucene.util.BytesRefIterator

  `next`

- ## Field Details

  - ### EMPTY

    static final InputIterator EMPTY
    Singleton InputIterator that iterates over 0 BytesRefs.

- ## Method Details

  - ### weight

    long weight()
    A term's weight, higher numbers mean better suggestions.

  - ### payload

    BytesRef payload()
    An arbitrary byte[] to record per suggestion. See `Lookup.LookupResult.payload` to retrieve the payload for each suggestion.

  - ### hasPayloads

    boolean hasPayloads()
    Returns true if the iterator has payloads

  - ### contexts

    Set<BytesRef> contexts()
    A term's contexts context can be used to filter suggestions. May return null, if suggest entries do not have any context

  - ### hasContexts

    boolean hasContexts()
    Returns true if the iterator has contexts