Hi,
Please help me,
I would like to search based on geo location efficiently.
For that I would like to create shards/routing based on geohash.
(Suggestion: Sharding of geo_points)
The documentation does not contain example how to do sharding based on geohash.
Can you help me what is the problem with the example below?
Mapping:
{
"settings" : {
"number_of_shards" : 10,
"number_of_replicas" : 0
},
"mappings" : {
"transaction" : {
"_routing" : {
"required" : true,
"path" : "location.geohash"
},
"properties" : {
"_all" : {"enabled" : true},
"brand" : { "type":"String"},
"location" : {
"type":"geo_point",
"lat_lon":true,
"geohash":true,
"geohash_prefix":true,
"geohash_precision": "50km"
},
"value" : { "type":"float"},
"time" : { "type":"date" , "format":"YYYY-MM-dd HH:mm:ss" }
}
}
}
}
Cannot insert a document:
{
"brand" : "Tesco",
"location" : {
"lat" : 30,
"lon" : 30
},
"amount": 10
}
The error message says:
{
"error": "RoutingMissingException[routing is required for [shopping]/[transaction]/[null]]",
"status": 400
}
The documentation says, that ElasticSearch is able to "extract routing automatically" from the document.
Please help how to do sharding/routing based on geohash correctly.
Thanks
Béla