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

Geo Overhaul (work with multiple locations) #414

Closed
kimchy opened this issue Oct 8, 2010 · 1 comment
Closed

Geo Overhaul (work with multiple locations) #414

kimchy opened this issue Oct 8, 2010 · 1 comment

Comments

@kimchy
Copy link
Member

kimchy commented Oct 8, 2010

The current geo support does not work well when a document as multiple locations. For this reason, the structure of how geo information is indexed requires changing.

Note, sadly, this requires both reindexing of the data if geo features are used, and requires to predefine the geo_point type for geo location objects (where before, just an object with lat and lon fields were enough).

The geo_point has been changed. Now, a string representation (lat,lon) is always stored under the object name, for example:

{
    "pin" : {
        "location" : {
            "lat" : 40.12,
            "lon" : -71.34
        }
    }
}

Will cause a field called location with the "40.12,-71.34" value to be stored. lat/lon are not stored by default now, since they are not needed, geohash can still be enabled as well.

The new options for geo_point are:

  • lat_lon: Set to true to also index a lat and lon fields.
  • geohash: Set to true to also index a geohash (under pin.location.geohash in our example).
  • geo_precision: The geohash precision. Defaults to 12.

When loading a geo point in a script using the doc[...] notion, a value (for example: doc['location'].value) returns a GeoPoint, which allows to access lat, lon, and geohash within the script (much simpler to be used in scripts compared to previously).

@kimchy
Copy link
Member Author

kimchy commented Oct 8, 2010

Geo Overhaul (work with multiple locations), closed by 6314c24.

medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011
medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011
…ge (again) how geo location is stored, not using geohash but explicit double conversion
ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant