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 filter format #3229

Closed
chilling opened this Issue Jun 24, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@chilling
Copy link
Contributor

commented Jun 24, 2013

The format of the geohash filter does not match the format other filters in the REST API. The fieldnames within the filter should match the fieldnames within the mapping.
Also the it should be possible to define the geohash_cell by a point in lat/lon format. Such a point can than transformed into a geohash.
In some corner cases the geohash_cell filter fails. i.e. the southern neighbor of cell 12b.

@chilling chilling closed this in 84fa9ea Jun 25, 2013

chilling added a commit that referenced this issue Jun 25, 2013

The `geohash_cell` filter now adapts the format of other geo-filters.…
… The oject fieldnames match the fieldnames document names automatically. This invalidates the `field` field in previeous versions. The value these fields value is a `geo_point` value (all formats supported) which is internally translated to a geohash. Since those points alway have a maximum precision (level 12) a `precision` definition has been included. This precision can either be defined as *length* of the geohash-string or as *distance*. It's assumed the a distance without any unit is a geohash-length.

```
GET 'http://127.0.0.1:9200/locations/_search?pretty=true' -d '{
    "query": {
        "match_all":{}
    },
    "filter": {
        "geohash_cell": {
			"pin": {
				"lat": 13.4080,
				"lon": 52.5186
			},
            "precision": 3,
            "neighbors": true
        }
    }
}'
```
Closes #3229

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

The `geohash_cell` filter now adapts the format of other geo-filters.…
… The oject fieldnames match the fieldnames document names automatically. This invalidates the `field` field in previeous versions. The value these fields value is a `geo_point` value (all formats supported) which is internally translated to a geohash. Since those points alway have a maximum precision (level 12) a `precision` definition has been included. This precision can either be defined as *length* of the geohash-string or as *distance*. It's assumed the a distance without any unit is a geohash-length.

```
GET 'http://127.0.0.1:9200/locations/_search?pretty=true' -d '{
    "query": {
        "match_all":{}
    },
    "filter": {
        "geohash_cell": {
			"pin": {
				"lat": 13.4080,
				"lon": 52.5186
			},
            "precision": 3,
            "neighbors": true
        }
    }
}'
```
Closes elastic#3229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.