Sharding of geo_points


(Bela Boros) #1

Please help me,
I cannot make sharding on geo_point work.
I would like to store one value and a geo location (latitude and longitude) in a document.
I would like to populate shards (route) based on location.

Then I would like to query the the average value of the 50 closest location.

My mappings:
{
"mappings" : {
"DocType" : {
"_source" : { "enabled" : true },
"_all" : { "enabled" : true},
"_routing" : {
"required" : true,
"path" : "location"
},
"properties" : {
"location" : { "type":"geo_point", "lat_lon":true, "geohash":true, "geohash_prefix":true, "geohash_precision": "50km" },
"value" : { "type":"float" , "index":"not_analyzed" },
}
}
}
}

Settings for 10 shards and 0 replicas:
{
"number_of_shards" : 10,
"number_of_replicas" : 0
}

But all my documents with various lat and lon coordiantes are inserted into one shard.

Please help me what I have missed in the documentation.
Can I shard based on a geo-point field somehow.

The default sharding is not good for me, because the documents are scattered over the 10 shards and each node is overloaded.

Thanks,
Béla


Shards/routing based on geohash
(Mark Walkom) #2

When you route it needs to be on a value, it can't be on an array like that.
You could use a geohash instead.


(Bela Boros) #3

Thanks for pointing out the direction.

Is there a small working sample available?
(Mapping and efficient location based query that uses the geohash based routing)

Thanks,
Béla


(Mark Walkom) #4

Nope, I haven't seen anyone do this so I'd be interested to see your outcome.


(system) #5