-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch version: tried with 2.3.5, 2.4.4, 5.2.1 and 5.4.0
Plugins installed: nope
JVM version : 1.8.0_121-b13 (on mac os) and 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14
OS version : mac os 10.12.4 and Ubuntu 16.04
Description of the problem including expected versus actual behavior:
When using a geo-point the inserts sometimes fail with an 'illegal longitude value' error. The longitude value in the error could be interpreted as valid, when you subtract 360 it will give you the valid value (360 degrees are in a sphere like the earth). It might have something to do with the length in characters of the geohash (h4rr13h4rr13x fails, h4rr13h4rr13 succeeds). Another search direction might be a rounding error.
Steps to reproduce:
Create an index-mapping with a geo_point
curl -XPUT 'http://localhost:9200/my-index' -d '{
"mappings": {
"user": {
"_all": { "enabled": false },
"properties": {
"geoLocation": {
"type": "geo_point"
}
}
}
}
}'
Insert two documents :
curl -XPUT 'http://localhost:9200/my-index/user/4' -d '{"geoLocation":"h4rr13"}'
curl -XPUT 'http://localhost:9200/my-index/user/5' -d '{"geoLocation":"h4rr13h4rr13x"}'
The first insert succeeds and the second one fails :
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"illegal_argument_exception","reason":"illegal longitude value [370.25605011731386] for geoLocation"}},"status":400}
The second call should also succeed since it is a valid place : http://geohash.org/h4rr13h4rr13x