Skip to content

Add support for "unmapped_type" and "missing" options for _geo_distance sorting #28152

@coderbarncb

Description

@coderbarncb

Describe the feature: Support "unmapped_type" and "missing" options for _geo_distance sorting

Currently it is not possible to add said keywords to a _geo_distance search, internally only the FieldSortBuilder seems to support this.

Normally one can use the "unmapped_type" and "missing" options for sorting on fields which might not be present in all documents / indexes (e.g. when searching via an index alias).

However, the feature is NOT supported in the GeoDistanceSortBuilder, hence a search will not return any results for documents which do not have a geo_point field to sort on.


ON A SIDENOTE (my $0.2)

In general I do think that the sorting behaviour is not implemented correctly.
Why?
Searching and sorting are two different things. Documents which are found, but do not match the given sorting criteria should simply be returned at the "bottom" of the (sorted) list.

Elasticsearch however, REMOVES them from the search results. IMO this is simply wrong.

Hence either the relevant keywords should be supported by said SortBuilder OR the implementation must be "corrected" :-)

Cheerio!

Metadata

Metadata

Assignees

Labels

:Analytics/GeoIndexing, search aggregations of geo points and shapes>enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions