Module org.elasticsearch.xcore
Record Class QueryExtractorBuilder
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.ml.inference.trainedmodel.ltr.QueryExtractorBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,Rewriteable<LearningToRankFeatureExtractorBuilder>,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,LearningToRankFeatureExtractorBuilder,NamedXContentObject
public record QueryExtractorBuilder(String featureName, QueryProvider query, float defaultScore)
extends Record
implements LearningToRankFeatureExtractorBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic floatstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionQueryExtractorBuilder(String featureName, QueryProvider query) QueryExtractorBuilder(String featureName, QueryProvider query, float defaultScore) Creates an instance of aQueryExtractorBuilderrecord class.QueryExtractorBuilder(StreamInput input) -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedefaultScorerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefeatureNamerecord component.static QueryExtractorBuilderfromXContent(org.elasticsearch.xcontent.XContentParser parser, Object context) getName()final inthashCode()Returns a hash code value for this object.query()Returns the value of thequeryrecord component.final StringtoString()Returns a string representation of this record class.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidvalidate()voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
public static final org.elasticsearch.xcontent.ParseField NAME -
FEATURE_NAME
public static final org.elasticsearch.xcontent.ParseField FEATURE_NAME -
QUERY
public static final org.elasticsearch.xcontent.ParseField QUERY -
DEFAULT_SCORE
public static final org.elasticsearch.xcontent.ParseField DEFAULT_SCORE -
DEFAULT_SCORE_DEFAULT
public static float DEFAULT_SCORE_DEFAULT
-
-
Constructor Details
-
QueryExtractorBuilder
-
QueryExtractorBuilder
Creates an instance of aQueryExtractorBuilderrecord class.- Parameters:
featureName- the value for thefeatureNamerecord componentquery- the value for thequeryrecord componentdefaultScore- the value for thedefaultScorerecord component
-
QueryExtractorBuilder
- Throws:
IOException
-
-
Method Details
-
fromXContent
public static QueryExtractorBuilder fromXContent(org.elasticsearch.xcontent.XContentParser parser, Object context) -
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
featureName
Returns the value of thefeatureNamerecord component.- Specified by:
featureNamein interfaceLearningToRankFeatureExtractorBuilder- Returns:
- the value of the
featureNamerecord component
-
validate
- Specified by:
validatein interfaceLearningToRankFeatureExtractorBuilder- Throws:
Exception- If the extractor is invalid.
-
getName
- Specified by:
getNamein interfaceNamedXContentObject- Returns:
- The name of the XContentObject that is to be serialized
-
rewrite
- Specified by:
rewritein interfaceRewriteable<LearningToRankFeatureExtractorBuilder>- Throws:
IOException
-
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 '=='. -
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-
defaultScore
public float defaultScore()Returns the value of thedefaultScorerecord component.- Returns:
- the value of the
defaultScorerecord component
-