Skip to content

Allow to filter geo bounding box or distance based on indexed lat lon #1334

@kimchy

Description

@kimchy

The way geo distance and bounding box filters work by default is by doing in memory checks to see if the document matches the provided parameters. Those in memory checks are fast, and with the new optimize bounding box option in geo distance (on by default), distance checks are also fast.

But, sometimes its faster to do the checks using indexed lat/lon values, especially when either only doing the geo checks, or when the bounding box is "small".

The geo_bounding_box filter now allows to provide a type, which can be set to indexed (defaults to memory). When set to indexed, it will do checks based on indexed lat and lon.

The geo_distance and geo_distance_range filters allow to pass to the optimize_bbox parameter either none, indexed, or "memory" (defaults to memory).

Note, in order to use the indexed option, the geo_point mapping type must set lat_lon to true in its mapping in order to index them as well. Also, this option will not work properly for a document with multiple locations under the same field unless nested documents are used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions