org.elasticsearch.index.query
Class DisMaxQueryBuilder
java.lang.Object
org.elasticsearch.index.query.BaseQueryBuilder
org.elasticsearch.index.query.DisMaxQueryBuilder
- All Implemented Interfaces:
- ToXContent, QueryBuilder
public class DisMaxQueryBuilder
- extends BaseQueryBuilder
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, wait, wait, wait |
DisMaxQueryBuilder
public DisMaxQueryBuilder()
add
public DisMaxQueryBuilder add(QueryBuilder queryBuilder)
- Add a sub-query to this disjunction.
boost
public DisMaxQueryBuilder 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 DisMaxQueryBuilder 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.
doXContent
protected void doXContent(XContentBuilder builder,
ToXContent.Params params)
throws java.io.IOException
- Specified by:
doXContent
in class BaseQueryBuilder
- Throws:
java.io.IOException