| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | [[query-dsl-dis-max-query]]=== Dis Max QueryA query that generates the union of documents produced by itssubqueries, and that scores each document with the maximum score forthat document as produced by any subquery, plus a tie breaking incrementfor any additional matching subqueries.This is useful when searching for a word in multiple fields withdifferent boost factors (so that the fields cannot be combinedequivalently into a single search field). We want the primary score tobe the one associated with the highest boost, not the sum of the fieldscores (as Boolean Query would give). If the query is "albino elephant"this ensures that "albino" matching one field and "elephant" matchinganother gets a higher score than "albino" matching both fields. To getthis result, use both Boolean Query and DisjunctionMax Query: for eachterm a DisjunctionMaxQuery searches for it in each field, while the setof these DisjunctionMaxQuery's is combined into a BooleanQuery.The tie breaker capability allows results that include the same term inmultiple fields to be judged better than results that include this termin only the best of those multiple fields, without confusing this withthe better case of two different terms in the multiple fields.Thedefault `tie_breaker` is `0.0`.This query maps to Lucene `DisjunctionMaxQuery`.[source,js]--------------------------------------------------{    "dis_max" : {        "tie_breaker" : 0.7,        "boost" : 1.2,        "queries" : [            {                "term" : { "age" : 34 }            },            {                "term" : { "age" : 35 }            }        ]    }}    --------------------------------------------------
 |