Geo-bounding box query does not support `topLeft` & `bottomLeft`

The documentation states that:

More over the names topLeft , bottomRight , topRight and bottomLeft are supported

However, using topLeft & bottomRight causes an error:

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "failed to parse [geo_bounding_box] query. [failed to parse bounding box. unexpected field [topLeft]]"
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[48:19] [bool] failed to parse field [filter]",
    "caused_by": {
      "type": "parse_exception",
      "reason": "failed to parse [geo_bounding_box] query. [failed to parse bounding box. unexpected field [topLeft]]"
    }
  },
  "status": 400
}

I would have filed an issue, but Sign in to GitHub · GitHub GitHub mentions this forum for unconfirmed bugs.

Could you provide 1) Elasticsearch version 2) the exact query that is generating the error you posted above?

Version

7.12.1

Example query

{
  "size": 1,
  "query": {
    "geo_bounding_box": {
      "coordinates": {
        "topLeft": {
          "lat": 75.76654624435699,
          "lon": -168.25100089690216
        },
        "bottomRight": {
          "lat": -34.773502906183325,
          "lon": 179
        }
      }
    }
  }
}

You are using camel case instead of separating the words using underscore:

{
  "size": 1,
  "query": {
    "geo_bounding_box": {
      "coordinates": {
        "top_left": {
          "lat": 75.76654624435699,
          "lon": -168.25100089690216
        },
        "bottom_right": {
          "lat": -34.773502906183325,
          "lon": 179
        }
      }
    }
  }
}

I see, I think the docs are not correct, would you mind open an issue? I think we should address this.

You are using camel case instead of separating the words using underscore

I know. That's what I said in my first message. :slight_smile:

I know, my bad, I have corrected myself and agreed with you that docs should be corrected :slight_smile:

Thank you!

Thanks for your help! I'll create the issue in GitHub. Although, I wouldn't mind if actually the implementation would be changed to match the docs:

More over the names topLeft , bottomRight , topRight and bottomLeft are supported

:blush:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.