TermFrequencyAttribute (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.analysis.tokenattributes, interface: TermFrequencyAttribute

Package org.apache.lucene.analysis.tokenattributes

# Interface TermFrequencyAttribute

All Superinterfaces:
  `Attribute`

All Known Implementing Classes:
  `PackedTokenAttributeImpl`, `TermFrequencyAttributeImpl`

public interface TermFrequencyAttribute extends Attribute
Sets the custom term frequency of a term within one document. If this attribute is present in your analysis chain for a given field, that field must be indexed with `IndexOptions.DOCS_AND_FREQS`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getTermFrequency()`
  Returns the custom term frequency.
  `void`
  `setTermFrequency(int termFrequency)`
  Set the custom term frequency of the current term within one document.

- ## Method Details

  - ### setTermFrequency

    void setTermFrequency(int termFrequency)
    Set the custom term frequency of the current term within one document.

  - ### getTermFrequency

    int getTermFrequency()
    Returns the custom term frequency.