Search changes

search_type=scan deprecated

The scan search type has been deprecated. All benefits from this search type can now be achieved by doing a scroll request that sorts documents in _doc order, for instance:

GET /my_index/_search?scroll=2m
{
  "sort": [
    "_doc"
  ]
}

Scroll requests sorted by _doc have been optimized to more efficiently resume from where the previous request stopped, so this will have the same performance characteristics as the former scan search type.

search_type=count deprecated

The count search type has been deprecated. All benefits from this search type can now be achieved by setting size to 0, for instance:

GET /my_index/_search
{
  "aggs": {...},
  "size": 0
}

from + size limits

Elasticsearch will now return an error message if a query’s from + size is more than the index.max_result_window parameter. This parameter defaults to 10,000 which is safe for almost all clusters. Values higher than can consume significant chunks of heap memory per search and per shard executing the search. It’s safest to leave this value as it is and use the scroll api for any deep scrolling but this setting is dynamic so it can raised or lowered as needed.

Nested sorting

If sorting on field inside a nested object then the nested_path should be specified. Before there was an attempt to resolve the nested path automatically, but that was sometimes incorrect. To avoid confusion the nested_path should always be specified.

More Like This

The MoreLikeThisQueryBuilder#ignoreLike methods have been deprecated in favor of using the unlike methods.

MoreLikeThisBuilder#addItem has been deprecated in favor of using MoreLikeThisBuilder#addLikeItem.