elasticsearch-geo-shape

Failed to create valid geo_shape

笑着哭i 提交于 2020-06-29 05:40:12
问题 I'm getting a weird error while trying to create a geo_shape on ES 6.6.1. Say my index has the following mapping: PUT index { "mappings" : { "doc" : { "properties" : { "parcel" : { "type" : "geo_shape" } } } } } Then I try to index the following shape: PUT index/doc/1 { "parcel": { "type": "Polygon", "coordinates": [ [ [ -116.96938484446626, 32.657287303780286 ], [ -116.96965590466098, 32.65769347876227 ], [ -116.96968135808686, 32.6576270315712 ], [ -116.9696296695897, 32.65755262998358 ], [

Elasticsearch - MissingMethodException on running distanceInKm on geo_point array

自古美人都是妖i 提交于 2019-12-11 11:47:41
问题 I have an elasticsearch document which has an array of geo_points. I have created the mapping as: { "test": { "properties": { "locations": { "type": "geo_point" } } } } Now, I am trying to create a query in which I want to do some processing on the array of geo_points. I have created my query like this: { "query": { "filtered": { "filter": { "script": { "script": "sDistance = doc['locations'].values[0].distanceInKm(28.51818,77.096080);" } } } } } I want to calculate the distance of the point