Elasticsearch: Geo: Geo bounding box filter returning no results

Created on 21 Feb 2014  路  8Comments  路  Source: elastic/elasticsearch

My search:

{
  "filter": {
    "geo_bounding_box": {
      "location": {
        "top_left": {
          "lat": 90,
          "lon": -180
        },
        "bottom_right": {
          "lat": -90,
          "lon": 180
        }
      }
    }
  }
}

It returns no results.

If I change a value, it works.

>enhancement v1.5.0 v2.0.0-beta1

All 8 comments

Haha! So basically you don't want to filter anything, right?
I guess we should in that case detect that and don't apply the filter at all.

@chilling WDYT?

Yes, I don't want to filter anything.
But I expect to get results.

If I use 90/-180 & -90/179.9999 , it works.

same problem, it works if I have longitude 179.9999 or -179.9999

Validation of geo-points is turning this filter into:

GeoBoundingBoxFilter(loc, [90.0, 180.0], [-90.0, 180.0])

This probably isn't the right thing to do in this case, but using a geo-filter in this way is really bad for performance. You don't want to use this as a "match-all" query

@colings86 what do you think?

A workaround for this bug is to set the normalize flag to false, making the original request in this issue:

{
  "filter": {
    "geo_bounding_box": {
      "normalize": false,
      "location": {
        "top_left": {
          "lat": 90,
          "lon": -180
        },
        "bottom_right": {
          "lat": -90,
          "lon": 180
        }
      }
    }
  }
}

This will stop the -180 being converted to +180 but will require the calling code to ensure the top and bottom are within [-90, 90] and the left and right are within [-180,180]

Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpountz picture jpountz  路  3Comments

Praveen82 picture Praveen82  路  3Comments

malpani picture malpani  路  3Comments

brwe picture brwe  路  3Comments

clintongormley picture clintongormley  路  3Comments