-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
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!