-
-
Save gboivin/59ccd243c8259e53cb16 to your computer and use it in GitHub Desktop.
Boosting an or clause in a custom score filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"explain": true, | |
"from": 0, | |
"size": 50, | |
"query": { | |
"custom_filters_score": { | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"category.id": 1225 | |
} | |
} | |
] | |
} | |
}, | |
"filters": [ | |
{ | |
"filter": { | |
"or": [ | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "Nike", | |
//This boost is not getting applied | |
"boost": 2, | |
"operator": "and" | |
} | |
} | |
} | |
}, | |
{ | |
"query": { | |
"match": { | |
"title": { | |
"query": "Adidas", | |
//This boost is not getting applied | |
"boost": 1, | |
"operator": "and" | |
} | |
} | |
} | |
} | |
] | |
}, | |
"boost": 10 | |
}, | |
{ | |
"filter": { | |
"range": { | |
"savings": { | |
"from": "50", | |
"include_lower": true | |
} | |
} | |
}, | |
"boost": 5 | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment