Record Class UHComponents
java.lang.Object
java.lang.Record
org.apache.lucene.search.uhighlight.UHComponents
- Record Components:
terms
- Query: all terms we extracted (some may be position sensitive)phraseHelper
- Query: position-sensitive informationautomata
- Query: wildcards (i.e. multi-term query), not position sensitivehasUnrecognizedQueryPart
- Query: if part of the query (other than the extracted terms / automata) is a leaf we don't know
public record UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags)
extends Record
A parameter object to hold the components a
FieldOffsetStrategy
needs.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LabelledCharArrayMatcher[]
The field for theautomata
record component.private final String
The field for thefield
record component.The field for thefieldMatcher
record component.private final boolean
The field for thehasUnrecognizedQueryPart
record component.private final Set
<UnifiedHighlighter.HighlightFlag> The field for thehighlightFlags
record component.private final PhraseHelper
The field for thephraseHelper
record component.private final Query
The field for thequery
record component.private final BytesRef[]
The field for theterms
record component. -
Constructor Summary
ConstructorsConstructorDescriptionUHComponents
(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags) Creates an instance of aUHComponents
record class. -
Method Summary
Modifier and TypeMethodDescriptionautomata()
Returns the value of theautomata
record component.final boolean
Indicates whether some other object is "equal to" this one.field()
Returns the value of thefield
record component.Returns the value of thefieldMatcher
record component.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of thehasUnrecognizedQueryPart
record component.Returns the value of thehighlightFlags
record component.Returns the value of thephraseHelper
record component.query()
Returns the value of thequery
record component.BytesRef[]
terms()
Returns the value of theterms
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
field
The field for thefield
record component. -
fieldMatcher
The field for thefieldMatcher
record component. -
query
The field for thequery
record component. -
terms
The field for theterms
record component. -
phraseHelper
The field for thephraseHelper
record component. -
automata
The field for theautomata
record component. -
hasUnrecognizedQueryPart
private final boolean hasUnrecognizedQueryPartThe field for thehasUnrecognizedQueryPart
record component. -
highlightFlags
The field for thehighlightFlags
record component.
-
-
Constructor Details
-
UHComponents
public UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags) Creates an instance of aUHComponents
record class.- Parameters:
field
- the value for thefield
record componentfieldMatcher
- the value for thefieldMatcher
record componentquery
- the value for thequery
record componentterms
- the value for theterms
record componentphraseHelper
- the value for thephraseHelper
record componentautomata
- the value for theautomata
record componenthasUnrecognizedQueryPart
- the value for thehasUnrecognizedQueryPart
record componenthighlightFlags
- the value for thehighlightFlags
record component
-
-
Method Details
-
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 '=='. -
field
Returns the value of thefield
record component.- Returns:
- the value of the
field
record component
-
fieldMatcher
Returns the value of thefieldMatcher
record component.- Returns:
- the value of the
fieldMatcher
record component
-
query
Returns the value of thequery
record component.- Returns:
- the value of the
query
record component
-
terms
Returns the value of theterms
record component.- Returns:
- the value of the
terms
record component
-
phraseHelper
Returns the value of thephraseHelper
record component.- Returns:
- the value of the
phraseHelper
record component
-
automata
Returns the value of theautomata
record component.- Returns:
- the value of the
automata
record component
-
hasUnrecognizedQueryPart
public boolean hasUnrecognizedQueryPart()Returns the value of thehasUnrecognizedQueryPart
record component.- Returns:
- the value of the
hasUnrecognizedQueryPart
record component
-
highlightFlags
Returns the value of thehighlightFlags
record component.- Returns:
- the value of the
highlightFlags
record component
-