Class StoredLtrQueryBuilder
java.lang.Object
org.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>
org.codelibs.fess.opensearch.query.StoredLtrQueryBuilder
- All Implemented Interfaces:
org.opensearch.core.common.io.stream.NamedWriteable,org.opensearch.core.common.io.stream.Writeable,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentObject,org.opensearch.index.query.QueryBuilder,org.opensearch.index.query.Rewriteable<org.opensearch.index.query.QueryBuilder>
public class StoredLtrQueryBuilder
extends org.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>
implements org.opensearch.core.common.io.stream.NamedWriteable
A query builder for a stored LTR (Learning to Rank) query.
This builder constructs a query that uses a pre-trained LTR model
to re-rank search results based on a given set of features.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.opensearch.core.ParseFieldThe parse field for the active features.static final org.opensearch.core.ParseFieldThe parse field for the featureset name.static final org.opensearch.core.ParseFieldThe parse field for the model name.static final StringThe name of the query.static final org.opensearch.core.ParseFieldThe parse field for the query parameters.static final org.opensearch.core.ParseFieldThe parse field for the store name.Fields inherited from class org.opensearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryNameFields inherited from interface org.opensearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the list of active features.activeFeatures(List<String> activeFeatures) Sets the list of active features.protected booleandoEquals(StoredLtrQueryBuilder other) protected intprotected org.apache.lucene.search.QuerydoToQuery(org.opensearch.index.query.QueryShardContext context) protected voiddoWriteTo(org.opensearch.core.common.io.stream.StreamOutput out) protected voiddoXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) Gets the name of the featureset.featureSetName(String featureSetName) Sets the name of the featureset.Gets the name of the LTR model.Sets the name of the LTR model.params()Gets the parameters for the LTR query.Sets the parameters for the LTR query.Gets the name of the feature store.Sets the name of the feature store.Methods inherited from class org.opensearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, checkNegativeBoost, declareStandardFields, doRewrite, equals, extractInnerHitBuilders, filter, getName, hashCode, maybeConvertToBytesRef, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, validateFilterParams, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensearch.index.query.QueryBuilder
supportsIntraSegmentSearch, visitMethods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.opensearch.core.common.io.stream.Writeable
writeTo
-
Field Details
-
NAME
The name of the query.- See Also:
-
MODEL_NAME
public static final org.opensearch.core.ParseField MODEL_NAMEThe parse field for the model name. -
FEATURESET_NAME
public static final org.opensearch.core.ParseField FEATURESET_NAMEThe parse field for the featureset name. -
STORE_NAME
public static final org.opensearch.core.ParseField STORE_NAMEThe parse field for the store name. -
PARAMS
public static final org.opensearch.core.ParseField PARAMSThe parse field for the query parameters. -
ACTIVE_FEATURES
public static final org.opensearch.core.ParseField ACTIVE_FEATURESThe parse field for the active features.
-
-
Constructor Details
-
StoredLtrQueryBuilder
public StoredLtrQueryBuilder()Constructs a new stored LTR query builder.
-
-
Method Details
-
getWriteableName
- Specified by:
getWriteableNamein interfaceorg.opensearch.core.common.io.stream.NamedWriteable
-
doWriteTo
- Specified by:
doWriteToin classorg.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>- Throws:
IOException
-
doXContent
protected void doXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContentin classorg.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>- Throws:
IOException
-
doToQuery
protected org.apache.lucene.search.Query doToQuery(org.opensearch.index.query.QueryShardContext context) throws IOException - Specified by:
doToQueryin classorg.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>- Throws:
IOException
-
doEquals
- Specified by:
doEqualsin classorg.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>
-
doHashCode
protected int doHashCode()- Specified by:
doHashCodein classorg.opensearch.index.query.AbstractQueryBuilder<StoredLtrQueryBuilder>
-
modelName
Gets the name of the LTR model.- Returns:
- The model name.
-
modelName
Sets the name of the LTR model.- Parameters:
modelName- The model name.- Returns:
- This query builder.
-
featureSetName
Gets the name of the featureset.- Returns:
- The featureset name.
-
featureSetName
Sets the name of the featureset.- Parameters:
featureSetName- The featureset name.- Returns:
- This query builder.
-
storeName
Gets the name of the feature store.- Returns:
- The store name.
-
storeName
Sets the name of the feature store.- Parameters:
storeName- The store name.- Returns:
- This query builder.
-
params
Gets the parameters for the LTR query.- Returns:
- A map of query parameters.
-
params
Sets the parameters for the LTR query.- Parameters:
params- A map of query parameters.- Returns:
- This query builder.
-
activeFeatures
Gets the list of active features.- Returns:
- A list of active features.
-
activeFeatures
Sets the list of active features.- Parameters:
activeFeatures- A list of active features.- Returns:
- This query builder.
-