Created
September 17, 2018 08:37
-
-
Save AhmedHelalAhmed/2c8f0a0a911a0f5c41ae8ead73cfdcf6 to your computer and use it in GitHub Desktop.
ElasticSearch - sense query
This file contains hidden or 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
| GET _search | |
| { | |
| "query": | |
| { | |
| "match_all": {} | |
| } | |
| } | |
| Get / | |
| POST /pets/dog/_search | |
| POST /pets/dog/_search | |
| { | |
| "query": | |
| { | |
| "match": | |
| { | |
| "about": "ipsum" | |
| } | |
| } | |
| } | |
| POST /pets/dog/_search | |
| { | |
| "query": | |
| { | |
| "bool": | |
| { | |
| "must": | |
| [ | |
| { | |
| "match": { "about": "ipsum" } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| POST /pets/dog/_search | |
| { | |
| "query": | |
| { | |
| "bool": | |
| { | |
| "must": | |
| [ | |
| { | |
| "match": { "about": "ipsum" } | |
| } | |
| ], | |
| "should": | |
| [ | |
| { | |
| "term": {"goodDog": true} | |
| }, | |
| { | |
| "term": {"gender": "male"} | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| POST /pets/dog/_search?explain | |
| { | |
| "query": | |
| { | |
| "bool": | |
| { | |
| "must": | |
| [ | |
| { | |
| "match": { "about": "ipsum" } | |
| } | |
| ], | |
| "should": | |
| [ | |
| { | |
| "term": {"goodDog": true} | |
| }, | |
| { | |
| "term": {"gender": "male"} | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| POST /pets/dog/_search | |
| { | |
| "query": | |
| { | |
| "bool": | |
| { | |
| "must": | |
| [ | |
| { | |
| "match": { "about": "ipsum" } | |
| } | |
| ], | |
| "filter": | |
| [ | |
| { | |
| "range": | |
| { | |
| "registered": | |
| { | |
| "gte": "2015-01-01" | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| GET /pets/bird/_search | |
| { | |
| "query": | |
| { | |
| "match_all": {} | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment