Package org.elasticsearch.search.rescore
Class QueryRescorerBuilder
java.lang.Object
org.elasticsearch.search.rescore.RescorerBuilder<QueryRescorerBuilder>
org.elasticsearch.search.rescore.QueryRescorerBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,Rewriteable<RescorerBuilder<QueryRescorerBuilder>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.search.rescore.RescorerBuilder
DEFAULT_WINDOW_SIZE, windowSize
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionRead from a stream.QueryRescorerBuilder(QueryBuilder builder)
Creates a newQueryRescorerBuilder
instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
doWriteTo(StreamOutput out)
void
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
boolean
static QueryRescorerBuilder
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
float
Gets the original query weight for rescoring.float
Gets the original query weight for rescoring.Gets the original query score mode.Returns the name of the writeable objectint
hashCode()
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, parseFromXContent, toString, toXContent, windowSize, windowSize, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
DEFAULT_RESCORE_QUERYWEIGHT
public static final float DEFAULT_RESCORE_QUERYWEIGHT- See Also:
- Constant Field Values
-
DEFAULT_QUERYWEIGHT
public static final float DEFAULT_QUERYWEIGHT- See Also:
- Constant Field Values
-
DEFAULT_SCORE_MODE
-
-
Constructor Details
-
QueryRescorerBuilder
Creates a newQueryRescorerBuilder
instance- Parameters:
builder
- the query builder to build the rescore query from
-
QueryRescorerBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classRescorerBuilder<QueryRescorerBuilder>
- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object -
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
public void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContent
in classRescorerBuilder<QueryRescorerBuilder>
- Throws:
IOException
-
fromXContent
public static QueryRescorerBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-
innerBuildContext
public QueryRescorer.QueryRescoreContext innerBuildContext(int windowSize, SearchExecutionContext context) throws IOExceptionDescription copied from class:RescorerBuilder
Extensions override this to build the context that they need for rescoring.- Specified by:
innerBuildContext
in classRescorerBuilder<QueryRescorerBuilder>
- Throws:
IOException
-
hashCode
public final int hashCode()- Overrides:
hashCode
in classRescorerBuilder<QueryRescorerBuilder>
-
equals
- Overrides:
equals
in classRescorerBuilder<QueryRescorerBuilder>
-
rewrite
Description copied from interface:Rewriteable
Rewrites 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
-