WeightedTerm (Lucene 10.5.1 highlighter API)
Description: declaration: package: org.apache.lucene.search.highlight, class: WeightedTerm

Package org.apache.lucene.search.highlight

# Class WeightedTerm

java.lang.Object
org.apache.lucene.search.highlight.WeightedTerm

Direct Known Subclasses:
  `WeightedSpanTerm`

public class WeightedTerm extends Object
Lightweight class to hold term and a weight value used for scoring this term

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WeightedTerm(float weight, String term)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getTerm()`
  `float`
  `getWeight()`
  `void`
  `setTerm(String term)`
  `void`
  `setWeight(float weight)`

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

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

- ## Constructor Details

  - ### WeightedTerm

    public WeightedTerm(float weight, String term)

- ## Method Details

  - ### getTerm

    public String getTerm()
    Returns:
      the term value (stemmed)

  - ### getWeight

    public float getWeight()
    Returns:
      the weight associated with this term

  - ### setTerm

    public void setTerm(String term)
    Parameters:
      `term` - the term value (stemmed)

  - ### setWeight

    public void setWeight(float weight)
    Parameters:
      `weight` - the weight associated with this term