Record Class HighlightConfig

java.lang.Object
java.lang.Record
org.elasticsearch.compute.operator.HighlightConfig
Record Components:
wordBoundary - when true the unified highlighter breaks fragments on word boundaries instead of sentences (the boundary_scanner=word option).
locale - locale used by the break iterator (the boundary_scanner_locale option).
orderByScore - when true fragments are returned by descending score instead of document order (the order=score option).
maxAnalyzedOffset - per-field analysis bound; a negative value means "use the default index setting" in the current coordinator-side operator.

public record HighlightConfig(String queryText, String preTag, String postTag, String encoder, int numberOfFragments, int fragmentSize, int noMatchSize, boolean wordBoundary, Locale locale, boolean orderByScore, int maxAnalyzedOffset) extends Record
Compute-side configuration handed straight to HighlightOperator. The planner resolves the user-facing WITH { ... } options into the primitive values carried here, and the operator builds its Lucene machinery from them. Keeping this record in the compute module (rather than referencing the ES|QL planning-layer options type) means the operator depends only on plain primitives.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Encoder name that escapes HTML markup in the highlighted text; any other value uses the default (no escaping).
  • Constructor Summary

    Constructors
    Constructor
    Description
    HighlightConfig(String queryText, String preTag, String postTag, String encoder, int numberOfFragments, int fragmentSize, int noMatchSize, boolean wordBoundary, Locale locale, boolean orderByScore, int maxAnalyzedOffset)
    Creates an instance of a HighlightConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Returns the value of the encoder record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the fragmentSize record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the locale record component.
    int
    Returns the value of the maxAnalyzedOffset record component.
    int
    Returns the value of the noMatchSize record component.
    int
    Returns the value of the numberOfFragments record component.
    boolean
    Returns the value of the orderByScore record component.
    Returns the value of the postTag record component.
    Returns the value of the preTag record component.
    Returns the value of the queryText record component.
    Returns a string representation of this record class.
    boolean
    Returns the value of the wordBoundary record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • HTML_ENCODER

      public static final String HTML_ENCODER
      Encoder name that escapes HTML markup in the highlighted text; any other value uses the default (no escaping).
      See Also:
  • Constructor Details

    • HighlightConfig

      public HighlightConfig(String queryText, String preTag, String postTag, String encoder, int numberOfFragments, int fragmentSize, int noMatchSize, boolean wordBoundary, Locale locale, boolean orderByScore, int maxAnalyzedOffset)
      Creates an instance of a HighlightConfig record class.
      Parameters:
      queryText - the value for the queryText record component
      preTag - the value for the preTag record component
      postTag - the value for the postTag record component
      encoder - the value for the encoder record component
      numberOfFragments - the value for the numberOfFragments record component
      fragmentSize - the value for the fragmentSize record component
      noMatchSize - the value for the noMatchSize record component
      wordBoundary - the value for the wordBoundary record component
      locale - the value for the locale record component
      orderByScore - the value for the orderByScore record component
      maxAnalyzedOffset - the value for the maxAnalyzedOffset record component
  • Method Details

    • describe

      public String describe()
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • queryText

      public String queryText()
      Returns the value of the queryText record component.
      Returns:
      the value of the queryText record component
    • preTag

      public String preTag()
      Returns the value of the preTag record component.
      Returns:
      the value of the preTag record component
    • postTag

      public String postTag()
      Returns the value of the postTag record component.
      Returns:
      the value of the postTag record component
    • encoder

      public String encoder()
      Returns the value of the encoder record component.
      Returns:
      the value of the encoder record component
    • numberOfFragments

      public int numberOfFragments()
      Returns the value of the numberOfFragments record component.
      Returns:
      the value of the numberOfFragments record component
    • fragmentSize

      public int fragmentSize()
      Returns the value of the fragmentSize record component.
      Returns:
      the value of the fragmentSize record component
    • noMatchSize

      public int noMatchSize()
      Returns the value of the noMatchSize record component.
      Returns:
      the value of the noMatchSize record component
    • wordBoundary

      public boolean wordBoundary()
      Returns the value of the wordBoundary record component.
      Returns:
      the value of the wordBoundary record component
    • locale

      public Locale locale()
      Returns the value of the locale record component.
      Returns:
      the value of the locale record component
    • orderByScore

      public boolean orderByScore()
      Returns the value of the orderByScore record component.
      Returns:
      the value of the orderByScore record component
    • maxAnalyzedOffset

      public int maxAnalyzedOffset()
      Returns the value of the maxAnalyzedOffset record component.
      Returns:
      the value of the maxAnalyzedOffset record component