Skip to content

Instantly share code, notes, and snippets.

@diloabininyeri
Last active November 19, 2018 08:53
Show Gist options
  • Save diloabininyeri/6b84c1323692fcb53939bdba35cae9d1 to your computer and use it in GitHub Desktop.
Save diloabininyeri/6b84c1323692fcb53939bdba35cae9d1 to your computer and use it in GitHub Desktop.
elasticsearch bool,must,mus_not compound query example
POST http://localhost:9200/accounts/person/_search
Content-Type: application/json
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "sevda",
"fields": [
"name",
"lastname"
]
}
},
"must_not": {
"range": {
"age": {
"gt": 23
}
}
}
}
}
}
### get all users name,lastname sevda and age is not gratherthen 23 from accounts/person
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment