Skip to content

Instantly share code, notes, and snippets.

@missinglink
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save missinglink/dd1dcdb377a0ff271890 to your computer and use it in GitHub Desktop.

Select an option

Save missinglink/dd1dcdb377a0ff271890 to your computer and use it in GitHub Desktop.
pelias category query
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