I wan to make use of elastic search shape queries which work well with spring-data-es so far. The problem is when creating the index from my java application the automatic mapping looks like this:
"shape" : {
"properties" : {
"coordinates" : {
"type" : "double"
},
"type" : {
"type" : "string"
}
}
}
So it just Indexes all my coordinates as double array while I need this:
"shape": {
"type": "geo_shape",
"tree": "quadtree",
"precision": "5m"
}
So. How to implement a custom mapping? There is a annotation called @GeoPointField which makes a GeoPoint mapping. That one looks not to complicated so implementing this by myself shouldn't be to much of a problem but I can't find the implementation for the annotation and so I'm kinda stuck. Also ok would be to use: ElasticSearchTemplate.putMapping(indexName, type, mapping) but I can't find what to put into mapping as its Type Object.