Created
January 13, 2016 17:19
-
-
Save luhn/bfa22bbded20be33bdac to your computer and use it in GitHub Desktop.
Elasticsearch query
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
{ | |
"query": { | |
"filtered": { | |
"filter": { | |
"and": [ | |
{ | |
"term": { | |
"deleted": false | |
} | |
}, | |
{ | |
"term": { | |
"verified": true | |
} | |
} | |
] | |
}, | |
"query": { | |
"boosting": { | |
"positive": { | |
"bool": { | |
"minimum_should_match": 0, | |
"should": { | |
"term": { | |
"has_reservations": true | |
} | |
}, | |
"must": [ | |
{ | |
"bool": { | |
"should": [ | |
{ | |
"match": { | |
"name": { | |
"operator": "and", | |
"query": "My query", | |
"boost": 1.0, | |
"fuzziness": "AUTO" | |
} | |
} | |
}, | |
{ | |
"match": { | |
"cuisine": { | |
"operator": "and", | |
"query": "My query", | |
"boost": 0.5, | |
"fuzziness": "AUTO" | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"terms": { | |
"cuisine_id": 14 | |
} | |
} | |
] | |
} | |
}, | |
"negative": { | |
"bool": { | |
"minimum_should_match": 1, | |
"should": [ | |
{ | |
"term": { | |
"closed": true | |
} | |
} | |
] | |
} | |
}, | |
"negative_boost": 0.2 | |
} | |
} | |
} | |
}, | |
"from": 0, | |
"fields": [ | |
"name" | |
], | |
"size": 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment