0
0
Elasticsearchquery~5 mins

Boosting query in Elasticsearch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AMatches documents to increase their score
BMatches documents to decrease their score
CFilters out documents
DSorts documents alphabetically
What value range should 'negative_boost' have?
AGreater than 1
BEqual to 1
CBetween 0 and 1
DLess than 0
If a document matches both positive and negative queries, what happens?
AIts score is boosted then reduced by negative_boost
BIts score is only reduced
CIts score is only boosted
DIt is excluded from results
Which Elasticsearch query type is used inside a Boosting query?
AMatch query
BAny valid query
CTerm query
DRange query only
What is the main purpose of using a Boosting query?
ATo count documents
BTo sort documents alphabetically
CTo filter out unwanted documents completely
DTo adjust ranking by promoting some results and demoting 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.