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: bounding box filter #290

Closed
kimchy opened this issue Aug 2, 2010 · 1 comment
Closed

Geo: bounding box filter #290

kimchy opened this issue Aug 2, 2010 · 1 comment

Comments

@kimchy
Copy link
Member

kimchy commented Aug 2, 2010

A filter allowing to filter hits based on a point location using a bounding box. Assuming the following indexed document:

{
    "pin" : {
        "location" : {
            "lat" : 40.12,
            "lon" : -71.34
        }
    }
}

Then the following simple query can be executed with a geo_bounding_box filter:

{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.717,
                        "lon" : -73.99
                    }
                }
            }
        }
    }
}

Accepted Formats

In much the same way the geo_point type can accept different representation of the geo point, the filter can accept it as well:

Lat Lon As Properties

{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : {
                        "lat" : 40.73,
                        "lon" : -74.1
                    },
                    "bottom_right" : {
                        "lat" : 40.717,
                        "lon" : -73.99
                    }
                }
            }
        }
    }
}

Lat Lon As Array

{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : [40.73, -74.1],
                    "bottom_right" : [40.717, -73.99]
                }
            }
        }
    }
}

Lat Lon As String

{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "40.73, -74.1",
                    "bottom_right" : "40.717, -73.99"
                }
            }
        }
    }
}

Geohash

{
    "filtered" : {
        "query" : {
            "match_all" : {}
        },
        "filter" : {
            "geo_bounding_box" : {
                "pin.location" : {
                    "top_left" : "drm3btev3e86",
                    "bottom_right" : "drm3btev3e86"
                }
            }
        }
    }
}

geo_point Type

The filter does not require the geo_point type to be set. It assumes that the location object indexed includes a lat and lon numeric values. The geo_point type follows these rules and allows for more flexible indexing options / structure, but is not required.

Multi Location Per Document

The filter can work with multiple locations / points per document. Once a single location / point matches the filter, the document will be included in the filter.

@kimchy
Copy link
Member Author

kimchy commented Aug 2, 2010

Geo: bounding box filter, closed by de8ffaf.

dadoonet pushed a commit to dadoonet/elasticsearch that referenced this issue Sep 4, 2015
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
…lastic#290)

Updated test2.tfvars for cdn and bringing up to date

* Updated test2.tfvars for cdn and bringing up to date


Approved-by: Marlon Jackson
costin pushed a commit that referenced this issue Dec 6, 2022
This PR removes old endpoints and planner as we no longer use them. I
removed the old planner's tests. I think we should write new tests for
the new planner.

Closes #290
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
With this commit we increase the value of the setting
`indexing_limits.memory.limit` that has been introduced in
elastic#58885 from its default (10%) to 80% for the PMC
indexing benchmarks with the default heap configuration (1GB). This is
necessary to ensure that Elasticsearch does not push back too
aggressively which would cause bulk-indexing to fail immediately with
this setup.

Relates elastic#58885
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant