org.elasticsearch.index.query.xcontent
Class ConstantScoreQueryBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.xcontent.BaseQueryBuilder
      extended by org.elasticsearch.index.query.xcontent.ConstantScoreQueryBuilder
All Implemented Interfaces:
ToXContent, QueryBuilder, XContentQueryBuilder

public class ConstantScoreQueryBuilder
extends BaseQueryBuilder

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
ConstantScoreQueryBuilder(XContentFilterBuilder filterBuilder)
          A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.
 
Method Summary
 ConstantScoreQueryBuilder boost(float boost)
          Sets the boost for this query.
protected  void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 
Methods inherited from class org.elasticsearch.index.query.xcontent.BaseQueryBuilder
buildAsBytes, buildAsBytes, buildAsUnsafeBytes, buildAsUnsafeBytes, toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantScoreQueryBuilder

public ConstantScoreQueryBuilder(XContentFilterBuilder filterBuilder)
A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.

Parameters:
filterBuilder - The filter to wrap in a constant score query
Method Detail

boost

public ConstantScoreQueryBuilder boost(float boost)
Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.


doXContent

protected void doXContent(XContentBuilder builder,
                          ToXContent.Params params)
                   throws java.io.IOException
Specified by:
doXContent in class BaseQueryBuilder
Throws:
java.io.IOException