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>>

public class QueryRescorerBuilder
extends RescorerBuilder<QueryRescorerBuilder>
  • Field Details

  • Constructor Details

    • QueryRescorerBuilder

      public QueryRescorerBuilder​(QueryBuilder builder)
      Creates a new QueryRescorerBuilder instance
      Parameters:
      builder - the query builder to build the rescore query from
    • QueryRescorerBuilder

      public QueryRescorerBuilder​(StreamInput in) throws java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details

    • doWriteTo

      public void doWriteTo​(StreamOutput out) throws java.io.IOException
      Specified by:
      doWriteTo in class RescorerBuilder<QueryRescorerBuilder>
      Throws:
      java.io.IOException
    • getWriteableName

      public java.lang.String getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
    • getRescoreQuery

      public QueryBuilder getRescoreQuery()
      Returns:
      the query used for this rescore query
    • setQueryWeight

      public QueryRescorerBuilder setQueryWeight​(float queryWeight)
      Sets the original query weight for rescoring. The default is 1.0
    • getQueryWeight

      public float getQueryWeight()
      Gets the original query weight for rescoring. The default is 1.0
    • setRescoreQueryWeight

      public QueryRescorerBuilder setRescoreQueryWeight​(float rescoreQueryWeight)
      Sets the original query weight for rescoring. The default is 1.0
    • getRescoreQueryWeight

      public float getRescoreQueryWeight()
      Gets the original query weight for rescoring. The default is 1.0
    • setScoreMode

      public QueryRescorerBuilder setScoreMode​(QueryRescoreMode scoreMode)
      Sets the original query score mode. The default is QueryRescoreMode.Total.
    • getScoreMode

      public QueryRescoreMode getScoreMode()
      Gets the original query score mode. The default is total
    • doXContent

      public void doXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      doXContent in class RescorerBuilder<QueryRescorerBuilder>
      Throws:
      java.io.IOException
    • fromXContent

      public static QueryRescorerBuilder fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • innerBuildContext

      public QueryRescorer.QueryRescoreContext innerBuildContext​(int windowSize, SearchExecutionContext context) throws java.io.IOException
      Description copied from class: RescorerBuilder
      Extensions override this to build the context that they need for rescoring.
      Specified by:
      innerBuildContext in class RescorerBuilder<QueryRescorerBuilder>
      Throws:
      java.io.IOException
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class RescorerBuilder<QueryRescorerBuilder>
    • equals

      public final boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class RescorerBuilder<QueryRescorerBuilder>
    • rewrite

      public QueryRescorerBuilder rewrite​(QueryRewriteContext ctx) throws java.io.IOException
      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:
      java.io.IOException