Last active
November 19, 2018 09:14
-
-
Save diloabininyeri/34b53c81cff5e3e70cf3cc45723c5d07 to your computer and use it in GitHub Desktop.
elasticsearch bool,must,must_not,sort,sort example
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
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": 100 | |
} | |
} | |
} | |
} | |
}, | |
"sort":{ | |
"age":"asc" | |
}, | |
"from":0, | |
"size":20 | |
} | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment