Skip to content

Instantly share code, notes, and snippets.

@cigolpl
Created May 5, 2016 11:20
Show Gist options
  • Save cigolpl/5fe67251645e28f9ba5f9ad5be6a7f7d to your computer and use it in GitHub Desktop.
Save cigolpl/5fe67251645e28f9ba5f9ad5be6a7f7d to your computer and use it in GitHub Desktop.
{
"name": "restaurants",
"type": "restaurants",
"index": "restaurants",
"defaults": {
"sort": "rating"
},
"schema": {
"name": {
"type": "string",
"store": true
},
"city": {
"type": "string",
"store": true,
"index": "not_analyzed"
},
"country": {
"type": "string",
"index": "not_analyzed",
"store": true
},
"country_icon": {
"type": "string",
"display": "image"
},
"rating": {
"type": "float"
},
"likes": {
"type": "string",
"index": "not_analyzed",
"store": true
},
"geo": {
"type": "geo_point"
}
},
"sortings": {
"rating": {
"title": "Rating",
"type": "normal",
"order": "desc",
"field": "rating"
},
"country": {
"title": "Country",
"type": "normal",
"order": "asc",
"field": "country"
},
"distance": {
"title": "Distance",
"type": "geo",
"order": "asc",
"field": "geo"
},
"city": {
"title": "City",
"type": "normal",
"order": "asc",
"field": "city"
}
},
"table": {
"fields": [
"country_icon",
"name",
"country",
"city",
"rating",
"geo"
]
},
"aggregations": {
"country": {
"type": "terms",
"field": "country",
"size": 10,
"title": "Country"
},
"distance_ranges": {
"type": "geo_distance",
"field": "geo",
"ranges": [
{
"lte": 500,
"name": "< 500"
},
{
"gte": 500,
"lte": 1000,
"name": "500 - 1000"
},
{
"gte": 500,
"name": "> 1000"
}
],
"unit": "km",
"title": "Distance ranges [km]"
},
"ratings": {
"type": "range",
"field": "rating",
"title": "Rating",
"ranges": [
{
"lte": 2,
"name": "1 - 2"
},
{
"lte": 3,
"gte": 2,
"name": "2 - 3"
},
{
"gte": 3,
"lte": 4,
"name": "3 - 4"
},
{
"gte": 4,
"name": "4 - 5"
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment