A boosting query promotes documents matching a positive query while demoting, rather than removing, documents matching a negative query. It is useful when relevance should favor one group but still retain less-preferred matches. section 11.5 section 11.8
Prefer affordable LG televisions
Search for televisions with a positive term query, then place televisions priced at $2,500 or more lower in the results by setting negative_boost to 0.5. The expensive televisions remain searchable; their relevance scores are recalculated downward. section 11.5
The positive and negative parts can contain leaf queries or compound queries. For example, a bool query can match televisions positively and Sony products negatively, then apply the same negative_boost mechanism. section 11.5
Use the query when:
- A preferred category should rank first without excluding other matching documents. section 11.5
- A measurable condition, such as high price or a brand, should lower relevance rather than act as a hard filter. section 11.5
- Several matching conditions must be combined inside positive or negative clauses. section 11.5 section 11.2
