org.elasticsearch.index.query.json
Class DisMaxJsonQueryBuilder
java.lang.Object
org.elasticsearch.index.query.json.BaseJsonQueryBuilder
org.elasticsearch.index.query.json.DisMaxJsonQueryBuilder
- All Implemented Interfaces:
- JsonQueryBuilder, QueryBuilder, ToJson
public class DisMaxJsonQueryBuilder
- extends BaseJsonQueryBuilder
A query that generates the union of documents produced by its sub-queries, and that scores each document
with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any
additional matching sub-queries.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DisMaxJsonQueryBuilder
public DisMaxJsonQueryBuilder()
add
public DisMaxJsonQueryBuilder add(JsonQueryBuilder queryBuilder)
- Add a sub-query to this disjunction.
boost
public DisMaxJsonQueryBuilder 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.
tieBreaker
public DisMaxJsonQueryBuilder tieBreaker(float tieBreaker)
- The score of each non-maximum disjunct for a document is multiplied by this weight
and added into the final score. If non-zero, the value should be small, on the order of 0.1, which says that
10 occurrences of word in a lower-scored field that is also in a higher scored field is just as good as a unique
word in the lower scored field (i.e., one that is not in any higher scored field.
doJson
protected void doJson(JsonBuilder builder,
ToJson.Params params)
throws java.io.IOException
- Specified by:
doJson
in class BaseJsonQueryBuilder
- Throws:
java.io.IOException