Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"geohash_precision" in mapping throws error when using format like "1km" #5448

Closed
tstibbs opened this issue Mar 18, 2014 · 1 comment · Fixed by #5449
Closed

"geohash_precision" in mapping throws error when using format like "1km" #5448

tstibbs opened this issue Mar 18, 2014 · 1 comment · Fixed by #5449
Assignees

Comments

@tstibbs
Copy link
Contributor

tstibbs commented Mar 18, 2014

The doc (http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/mapping-geo-point-type.html#_mapping_options) says you can specify the precision using strings like "1km" or "1m".

However, doing so returns an error, only specifying the precision using a number seems to be allowed.

E.g., create a new index like this:

curl -XPUT 'http://localhost:9200/test' -d '{
  "mappings": {
    "pin": {
      "properties": {
        "location": {
          "type": "geo_point",
          "geohash_precision": "1m"
        }
      }
    }
  }
}'

and you'll get an error like this:

{
  "error" : "MapperParsingException[mapping [pin]]; nested: NumberFormatException[For input string: \"1m\"]; ",
  "status" : 400
}

I'm using 1.0.0.

@spinscale spinscale self-assigned this Mar 18, 2014
@spinscale
Copy link
Contributor

just checked the source, we only parse integers there at the moment... should be relatively simple to fix from my birds eye view.

spinscale added a commit that referenced this issue Mar 18, 2014
Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes #5448
spinscale added a commit that referenced this issue Mar 18, 2014
Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes #5448
spinscale added a commit that referenced this issue Mar 18, 2014
Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes #5448
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes elastic#5448
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes elastic#5448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants