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

Regresion: geo distance filter - filters out proper geohashes #3073

Closed
kosz85 opened this Issue May 22, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@kosz85
Copy link

kosz85 commented May 22, 2013

Mapping of searched field:

location: {
   type: geo_point
}

I tried also with:

location: {
   lat_lon: true,
   type: geo_point,
   geohash: true,
   geohash_precision: 24
}

Query:

{
  "from": 0,
  "fields": [
    "_id",
    "_parent",
    "_routing",
    "_source"
  ],
  "filter": {
        "geo_distance": {
          "distance": "50mi",
          "optimize_bbox": "memory",
          "location": {
            "lat": 40.720611,
            "lon": -73.998776
          }
        }
  },
  "query": {
    "match_all": {}
  },
  "size": 20
}

Data:

{
 "location": "dr5rshgwz81eqnfrrrhz"
}

It works for 0.20.2 and don't work for current release 0.90.0

EDIT: Sorry I post it to fast, data attached :)

@chilling

This comment has been minimized.

Copy link
Contributor

chilling commented May 22, 2013

Hi @kosz85, can you also post a simple example of your indexed data, filters and results?

@kosz85

This comment has been minimized.

Copy link
Author

kosz85 commented May 22, 2013

I may add that 0.90.0 has no matches even for 5000mi

{
  "filter": {
        "geo_distance": {
          "distance": "50mi",
          "optimize_bbox": "memory",
          "location": {
            "lat": 40.720611,
            "lon": -73.998776
          }
        }
  },
  "query": {
    "match_all": {}
  },
  "size": 20
}

Almost the same data in both instances

0.90.0

{
    "took": 2,
    "timed_out": false,
    "_shards": {
        "total": 3,
        "successful": 3,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

0.20.2

{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 220,
        "max_score": 1,
        "hits": [

(...)
              {
                "_id": "105",
                "_score": 1,
                "_source": {
                    "_id": 105,
                    "location": "dr72hbxdbzk3npz479cy"
               }
(...)

Explain on 0.90.0:

{
  "query": {
    "filtered": {
      "filter": {
          "geo_distance": {
            "distance": "50mi",
            "location": {
              "lat": 40.720611,
              "lon": -73.998776
            }
          }
       }
   }
}
-------
{
    "ok": true,
    "_index": "business_index",
    "_type": "business",
    "_id": "105",
    "matched": false,
    "explanation": {
        "value": 0,
        "description": "ConstantScore(GeoDistanceFilter(location, ARC, 50.0, 40.720611, -73.998776)) doesn't match id 7"
    }
}
@chilling

This comment has been minimized.

Copy link
Contributor

chilling commented Jun 7, 2013

@kosz85 thanks for open this issue. I think my commit will fix this

@ghost ghost assigned chilling Jun 7, 2013

@kosz85

This comment has been minimized.

Copy link
Author

kosz85 commented Jun 10, 2013

Thanks, fix worked after reindexing data. (We checked it on version 0.90.1 patched with this commit)

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.