Complete the code to create a boosting query that lowers the score of documents matching the negative query.
{
"query": {
"boosting": {
"positive": { "match_all": {} },
"negative": { "term": { "status": "archived" } },
"[1]": 0.2
}
}
}The negative_boost parameter sets the factor by which the score of documents matching the negative query is reduced.
Complete the code to boost documents matching the positive query with a higher score.
{
"query": {
"boosting": {
"positive": { "match": { "title": "[1]" } },
"negative": { "term": { "status": "draft" } },
"boost": 1.5
}
}
}The positive query matches documents with the word elasticsearch in the title, boosting their score.
Fix the error in the boosting query by completing the missing field name.
{
"query": {
"boosting": {
"positive": { "match": { "content": "search" } },
"negative": { "term": { "status": "deprecated" } },
"[1]": 0.1
}
}
}The correct field to reduce the score of negative matches is negative_boost.
Fill both blanks to create a boosting query that boosts documents with 'python' in the title and lowers score for status 'obsolete'.
{
"query": {
"boosting": {
"positive": { "match": { "title": "[1]" } },
"negative": { "term": { "status": "[2]" } },
"boost": 2.0
}
}
}The positive query matches 'python' in the title, and the negative query matches documents with status 'obsolete' to lower their score.
Fill all three blanks to create a boosting query that boosts documents with 'cloud' in description, lowers score for status 'inactive', and sets boost factor to 0.3.
{
"query": {
"boosting": {
"positive": { "match": { "description": "[1]" } },
"negative": { "term": { "status": "[2]" } },
"[3]": 0.3
}
}
}The positive query matches 'cloud' in description, the negative query matches status 'inactive', and the boost factor is set with negative_boost.