Module org.elasticsearch.compute
Record Class HighlightConfig
java.lang.Object
java.lang.Record
org.elasticsearch.compute.operator.HighlightConfig
- Record Components:
wordBoundary- whentruethe unified highlighter breaks fragments on word boundaries instead of sentences (theboundary_scanner=wordoption).locale- locale used by the break iterator (theboundary_scanner_localeoption).orderByScore- whentruefragments are returned by descending score instead of document order (theorder=scoreoption).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
FieldsModifier and TypeFieldDescriptionstatic final StringEncoder name that escapes HTML markup in the highlighted text; any other value uses the default (no escaping). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribe()encoder()Returns the value of theencoderrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefragmentSizerecord component.final inthashCode()Returns a hash code value for this object.locale()Returns the value of thelocalerecord component.intReturns the value of themaxAnalyzedOffsetrecord component.intReturns the value of thenoMatchSizerecord component.intReturns the value of thenumberOfFragmentsrecord component.booleanReturns the value of theorderByScorerecord component.postTag()Returns the value of thepostTagrecord component.preTag()Returns the value of thepreTagrecord component.Returns the value of thequeryTextrecord component.toString()Returns a string representation of this record class.booleanReturns the value of thewordBoundaryrecord component.
-
Field Details
-
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 aHighlightConfigrecord class.- Parameters:
queryText- the value for thequeryTextrecord componentpreTag- the value for thepreTagrecord componentpostTag- the value for thepostTagrecord componentencoder- the value for theencoderrecord componentnumberOfFragments- the value for thenumberOfFragmentsrecord componentfragmentSize- the value for thefragmentSizerecord componentnoMatchSize- the value for thenoMatchSizerecord componentwordBoundary- the value for thewordBoundaryrecord componentlocale- the value for thelocalerecord componentorderByScore- the value for theorderByScorerecord componentmaxAnalyzedOffset- the value for themaxAnalyzedOffsetrecord component
-
-
Method Details
-
describe
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
queryText
Returns the value of thequeryTextrecord component.- Returns:
- the value of the
queryTextrecord component
-
preTag
Returns the value of thepreTagrecord component.- Returns:
- the value of the
preTagrecord component
-
postTag
Returns the value of thepostTagrecord component.- Returns:
- the value of the
postTagrecord component
-
encoder
Returns the value of theencoderrecord component.- Returns:
- the value of the
encoderrecord component
-
numberOfFragments
public int numberOfFragments()Returns the value of thenumberOfFragmentsrecord component.- Returns:
- the value of the
numberOfFragmentsrecord component
-
fragmentSize
public int fragmentSize()Returns the value of thefragmentSizerecord component.- Returns:
- the value of the
fragmentSizerecord component
-
noMatchSize
public int noMatchSize()Returns the value of thenoMatchSizerecord component.- Returns:
- the value of the
noMatchSizerecord component
-
wordBoundary
public boolean wordBoundary()Returns the value of thewordBoundaryrecord component.- Returns:
- the value of the
wordBoundaryrecord component
-
locale
Returns the value of thelocalerecord component.- Returns:
- the value of the
localerecord component
-
orderByScore
public boolean orderByScore()Returns the value of theorderByScorerecord component.- Returns:
- the value of the
orderByScorerecord component
-
maxAnalyzedOffset
public int maxAnalyzedOffset()Returns the value of themaxAnalyzedOffsetrecord component.- Returns:
- the value of the
maxAnalyzedOffsetrecord component
-