Recall & Review
beginner
What is a Boosting query in Elasticsearch?
A Boosting query lets you increase the score of documents matching a positive query and decrease the score of documents matching a negative query, helping to rank results better.
Click to reveal answer
beginner
Which two main parts does a Boosting query have?
A Boosting query has a positive query to match preferred documents and a negative query to match documents to downrank.
Click to reveal answer
intermediate
What does the 'negative_boost' parameter do in a Boosting query?
The 'negative_boost' parameter reduces the score of documents matching the negative query by multiplying their score by this value (less than 1).
Click to reveal answer
beginner
How would you describe the effect of a Boosting query using a real-life example?
Imagine searching for 'apple' but you want to show fruit results higher and downrank results about the company Apple. The Boosting query boosts fruit matches and lowers company matches.
Click to reveal answer
intermediate
Show a simple JSON example of a Boosting query that boosts 'apple' fruit and downranks 'apple' company.
{
"boosting": {
"positive": { "match": { "content": "apple fruit" } },
"negative": { "match": { "content": "apple company" } },
"negative_boost": 0.3
}
}
Click to reveal answer
What does the 'positive' part of a Boosting query do?
✗ Incorrect
The 'positive' query matches documents whose score should be increased.
What value range should 'negative_boost' have?
✗ Incorrect
'negative_boost' is a multiplier less than 1 to reduce scores of negative matches.
If a document matches both positive and negative queries, what happens?
✗ Incorrect
The document's score is first boosted by the positive query, then reduced by the negative_boost factor.
Which Elasticsearch query type is used inside a Boosting query?
✗ Incorrect
Both positive and negative parts can use any valid Elasticsearch query.
What is the main purpose of using a Boosting query?
✗ Incorrect
Boosting queries adjust ranking by increasing scores of some documents and decreasing others.
Explain how a Boosting query works in Elasticsearch and why you might use it.
Think about how you can promote some results and lower others in search.
You got /4 concepts.
Write a simple Boosting query JSON that boosts documents containing 'chocolate' but lowers documents containing 'vanilla'.
Use the boosting query structure with positive, negative, and negative_boost.
You got /3 concepts.