mapping for the index
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "standard"
}
}
}
},
"mappings": {
"properties": {
"category": {
"type": "text",
"analyzer": "standard"
},
"coordinates": {
"type": "geo_point"
},
"businessHours": {
"type": "nested",
"properties": {
"dayStartTime": {
"type": "date"
},
"dayEndTime": {
"type": "date"
}
}
},
"followersCount": {
"type": "integer",
"coerce": false
},
"averageRating": {
"type": "float",
"coerce": false
},
}
}
sorting on multiple fields
sort=[
{
followersCount: {
order: 'desc'
}
},
{
averageRating: {
order: 'desc'
}
},
{
_geo_distance: {
coordinates: [
lng,
lat
],
order: "asc",
unit: "km",
distance_type: "arc",
ignore_unmapped: true
}
},
]