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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and 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 Detail

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

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