Last active
August 29, 2015 14:17
-
-
Save missinglink/dd1dcdb377a0ff271890 to your computer and use it in GitHub Desktop.
pelias category 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 /pelias/_search | |
| { | |
| "query": { | |
| "filtered": { | |
| "query": { | |
| "multi_match": { | |
| "query": "good", | |
| "fields": "name.*" | |
| } | |
| }, | |
| "filter": { | |
| "bool": { | |
| "must": [ | |
| { | |
| "term": { | |
| "category": "food:cuisine:chinese" | |
| } | |
| }, | |
| { | |
| "geo_distance": { | |
| "distance": "50km", | |
| "distance_type": "plane", | |
| "optimize_bbox": "indexed", | |
| "_cache": true, | |
| "center_point": { | |
| "lat": 52.50712, | |
| "lon": 13.32164 | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| }, | |
| "size": 100, | |
| "sort": [ | |
| { | |
| "_geo_distance": { | |
| "center_point": { | |
| "lat": 52.50712, | |
| "lon": 13.32164 | |
| }, | |
| "order": "asc", | |
| "unit": "km" | |
| } | |
| } | |
| ], | |
| "fields": [ | |
| "name.default", | |
| "category" | |
| ], | |
| "track_scores": true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment