java.lang.Object
org.elasticsearch.search.rescore.RescorerBuilder<QueryRescorerBuilder>
org.elasticsearch.search.rescore.QueryRescorerBuilder
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,Rewriteable<RescorerBuilder<QueryRescorerBuilder>>,ToXContent,ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 floatstatic final floatstatic final QueryRescoreModestatic final StringFields inherited from class org.elasticsearch.search.rescore.RescorerBuilder
DEFAULT_WINDOW_SIZE, WINDOW_SIZE_FIELD, windowSizeFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionRead from a stream.QueryRescorerBuilder(QueryBuilder builder) Creates a newQueryRescorerBuilderinstance -
Method Summary
Modifier and TypeMethodDescriptionvoiddoWriteTo(StreamOutput out) voiddoXContent(XContentBuilder builder, ToXContent.Params params) final booleanstatic QueryRescorerBuilderfromXContent(XContentParser parser) The minimal version of the recipient this object can be sent to.floatGets the original query weight for rescoring.floatGets the original query weight for rescoring.Gets the original query score mode.Returns the name of the writeable objectfinal inthashCode()innerBuildContext(int windowSize, SearchExecutionContext context) Extensions override this to build the context that they need for rescoring.Rewrites this instance based on the provided context.setQueryWeight(float queryWeight) Sets the original query weight for rescoring.setRescoreQueryWeight(float rescoreQueryWeight) Sets the original query weight for rescoring.setScoreMode(QueryRescoreMode scoreMode) Sets the original query score mode.Methods inherited from class org.elasticsearch.search.rescore.RescorerBuilder
buildContext, isWindowSizeRequired, parseFromXContent, toString, toXContent, validate, windowSize, windowSize, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Field Details
-
NAME
- See Also:
-
DEFAULT_RESCORE_QUERYWEIGHT
public static final float DEFAULT_RESCORE_QUERYWEIGHT- See Also:
-
DEFAULT_QUERYWEIGHT
public static final float DEFAULT_QUERYWEIGHT- See Also:
-
DEFAULT_SCORE_MODE
-
-
Constructor Details
-
QueryRescorerBuilder
Creates a newQueryRescorerBuilderinstance- Parameters:
builder- the query builder to build the rescore query from
-
QueryRescorerBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classRescorerBuilder<QueryRescorerBuilder>- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object -
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to. SeeVersionedNamedWriteable.supportsVersion(TransportVersion)for the default serialization check. -
getRescoreQuery
- Returns:
- the query used for this rescore query
-
setQueryWeight
Sets the original query weight for rescoring. The default is1.0 -
getQueryWeight
public float getQueryWeight()Gets the original query weight for rescoring. The default is1.0 -
setRescoreQueryWeight
Sets the original query weight for rescoring. The default is1.0 -
getRescoreQueryWeight
public float getRescoreQueryWeight()Gets the original query weight for rescoring. The default is1.0 -
setScoreMode
Sets the original query score mode. The default isQueryRescoreMode.Total. -
getScoreMode
Gets the original query score mode. The default istotal -
doXContent
- Specified by:
doXContentin classRescorerBuilder<QueryRescorerBuilder>- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
innerBuildContext
public QueryRescorer.QueryRescoreContext innerBuildContext(int windowSize, SearchExecutionContext context) throws IOException Description copied from class:RescorerBuilderExtensions override this to build the context that they need for rescoring.- Specified by:
innerBuildContextin classRescorerBuilder<QueryRescorerBuilder>- Throws:
IOException
-
hashCode
public final int hashCode()- Overrides:
hashCodein classRescorerBuilder<QueryRescorerBuilder>
-
equals
- Overrides:
equalsin classRescorerBuilder<QueryRescorerBuilder>
-
rewrite
Description copied from interface:RewriteableRewrites this instance based on the provided context. The returned objects will be the same instance as this if no changes during the rewrite were applied.- Throws:
IOException
-