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: Geo bounding box filter returning no results #5218

Closed
pierrre opened this issue Feb 21, 2014 · 8 comments
Closed

Geo: Geo bounding box filter returning no results #5218

pierrre opened this issue Feb 21, 2014 · 8 comments

Comments

@pierrre
Copy link

pierrre commented Feb 21, 2014

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.

@dadoonet
Copy link
Member

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?

@pierrre
Copy link
Author

pierrre commented Feb 21, 2014

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

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

@exAspArk
Copy link

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

@clintongormley
Copy link

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

@clintongormley
Copy link

@colings86 what do you think?

@colings86
Copy link
Contributor

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]

@colings86
Copy link
Contributor

Closed by #7340

@colings86 colings86 changed the title Geo bounding box filter returning no results Geo: Geo bounding box filter returning no results Sep 12, 2014
@pierrre
Copy link
Author

pierrre commented Sep 12, 2014

Thanks! :)

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

Successfully merging a pull request may close this issue.

6 participants