2016-03-13 16:17:48 -04:00
|
|
|
[[breaking_50_search_changes]]
|
|
|
|
=== Search and Query DSL changes
|
|
|
|
|
|
|
|
==== `search_type`
|
|
|
|
|
|
|
|
===== `search_type=count` removed
|
|
|
|
|
|
|
|
The `count` search type was deprecated since version 2.0.0 and is now removed.
|
|
|
|
In order to get the same benefits, you just need to set the value of the `size`
|
|
|
|
parameter to `0`.
|
|
|
|
|
|
|
|
For instance, the following request:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
---------------
|
|
|
|
GET /my_index/_search?search_type=count
|
|
|
|
{
|
|
|
|
"aggs": {
|
|
|
|
"my_terms": {
|
|
|
|
"terms": {
|
|
|
|
"field": "foo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
---------------
|
|
|
|
|
|
|
|
can be replaced with:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
---------------
|
|
|
|
GET /my_index/_search
|
|
|
|
{
|
|
|
|
"size": 0,
|
|
|
|
"aggs": {
|
|
|
|
"my_terms": {
|
|
|
|
"terms": {
|
|
|
|
"field": "foo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
---------------
|
|
|
|
|
|
|
|
===== `search_type=scan` removed
|
|
|
|
|
|
|
|
The `scan` search type was deprecated since version 2.1.0 and is now removed.
|
|
|
|
All benefits from this search type can now be achieved by doing a scroll
|
|
|
|
request that sorts documents in `_doc` order, for instance:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
---------------
|
|
|
|
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.
|
|
|
|
|
|
|
|
==== `fields` parameter
|
|
|
|
|
2016-06-27 11:20:32 -04:00
|
|
|
The `fields` parameter used to try to retrieve field values from stored
|
|
|
|
fields, and fall back to extracting from the `_source` if a field is not
|
|
|
|
marked as stored. Now, the `fields` parameter will only return stored fields
|
2016-03-13 16:17:48 -04:00
|
|
|
-- it will no longer extract values from the `_source`.
|
|
|
|
|
|
|
|
==== search-exists API removed
|
|
|
|
|
|
|
|
The search exists api has been removed in favour of using the search api with
|
|
|
|
`size` set to `0` and `terminate_after` set to `1`.
|
|
|
|
|
|
|
|
|
|
|
|
==== Deprecated queries removed
|
|
|
|
|
|
|
|
The following deprecated queries have been removed:
|
|
|
|
|
|
|
|
`filtered`:: Use `bool` query instead, which supports `filter` clauses too.
|
|
|
|
`and`:: Use `must` clauses in a `bool` query instead.
|
|
|
|
`or`:: Use `should` clauses in a `bool` query instead.
|
|
|
|
`limit`:: Use the `terminate_after` parameter instead.
|
|
|
|
`fquery`:: Is obsolete after filters and queries have been merged.
|
|
|
|
`query`:: Is obsolete after filters and queries have been merged.
|
|
|
|
`query_binary`:: Was undocumented and has been removed.
|
|
|
|
`filter_binary`:: Was undocumented and has been removed.
|
|
|
|
|
|
|
|
|
|
|
|
==== Changes to queries
|
|
|
|
|
2016-05-11 04:28:42 -04:00
|
|
|
* Unsupported queries such as term queries on `geo_point` fields will now fail
|
|
|
|
rather than returning no hits.
|
|
|
|
|
|
|
|
* Removed support for fuzzy queries on numeric, date and ip fields, use range
|
|
|
|
queries instead.
|
|
|
|
|
|
|
|
* Removed support for range and prefix queries on `_uid` and `_id` fields.
|
|
|
|
|
|
|
|
* Querying an unindexed field will now fail rather than returning no hits.
|
|
|
|
|
2016-03-13 16:17:48 -04:00
|
|
|
* Removed support for the deprecated `min_similarity` parameter in `fuzzy
|
|
|
|
query`, in favour of `fuzziness`.
|
|
|
|
|
|
|
|
* Removed support for the deprecated `fuzzy_min_sim` parameter in
|
|
|
|
`query_string` query, in favour of `fuzziness`.
|
|
|
|
|
|
|
|
* Removed support for the deprecated `edit_distance` parameter in completion
|
|
|
|
suggester, in favour of `fuzziness`.
|
|
|
|
|
|
|
|
* Removed support for the deprecated `filter` and `no_match_filter` fields in `indices` query,
|
|
|
|
in favour of `query` and `no_match_query`.
|
|
|
|
|
|
|
|
* Removed support for the deprecated `filter` fields in `nested` query, in favour of `query`.
|
|
|
|
|
|
|
|
* Removed support for the deprecated `minimum_should_match` and
|
|
|
|
`disable_coord` in `terms` query, use `bool` query instead. Also removed
|
|
|
|
support for the deprecated `execution` parameter.
|
|
|
|
|
|
|
|
* Removed support for the top level `filter` element in `function_score` query, replaced by `query`.
|
|
|
|
|
|
|
|
* The `collect_payloads` parameter of the `span_near` query has been deprecated. Payloads will be loaded when needed.
|
|
|
|
|
2016-04-19 05:54:48 -04:00
|
|
|
* The `score_type` parameter to the `nested` and `has_child` queries has been
|
|
|
|
removed in favour of `score_mode`. The `score_mode` parameter to `has_parent`
|
|
|
|
has been deprecated in favour of the `score` boolean parameter. Also, the
|
|
|
|
`total` score mode has been removed in favour of the `sum` mode.
|
2016-03-13 16:17:48 -04:00
|
|
|
|
2016-03-17 12:31:39 -04:00
|
|
|
* When the `max_children` parameter was set to `0` on the `has_child` query
|
|
|
|
then there was no upper limit on how many child documents were allowed to
|
|
|
|
match. Now, `0` really means that zero child documents are allowed. If no
|
|
|
|
upper limit is needed then the `max_children` parameter shouldn't be specified
|
|
|
|
at all.
|
2016-03-13 16:17:48 -04:00
|
|
|
|
2016-03-18 07:20:06 -04:00
|
|
|
* The `exists` query will now fail if the `_field_names` field is disabled.
|
|
|
|
|
2016-05-13 05:08:46 -04:00
|
|
|
* The `multi_match` query will fail if `fuzziness` is used for `cross_fields`, `phrase` or `phrase_prefix` type.
|
|
|
|
This parameter was undocumented and silently ignored before for these types of `multi_match`.
|
|
|
|
|
2016-04-28 07:56:50 -04:00
|
|
|
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoPolygonQuery. Use parameter validation_method instead.
|
2016-03-13 16:17:48 -04:00
|
|
|
|
2016-04-28 08:01:54 -04:00
|
|
|
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoDistanceRangeQuery. Use parameter validation_method instead.
|
2016-04-28 08:06:27 -04:00
|
|
|
|
|
|
|
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoDistanceQuery. Use parameter validation_method instead.
|
2016-04-28 08:10:59 -04:00
|
|
|
|
|
|
|
* Deprecated support for the coerce, normalize, ignore_malformed parameters in GeoBoundingBoxQuery. Use parameter validation_method instead.
|
2016-05-13 05:08:46 -04:00
|
|
|
|
2016-03-13 16:17:48 -04:00
|
|
|
==== Top level `filter` parameter
|
|
|
|
|
|
|
|
Removed support for the deprecated top level `filter` in the search api,
|
|
|
|
replaced by `post_filter`.
|
|
|
|
|
|
|
|
==== Highlighters
|
|
|
|
|
|
|
|
Removed support for multiple highlighter names, the only supported ones are:
|
|
|
|
`plain`, `fvh` and `postings`.
|
|
|
|
|
|
|
|
==== Term vectors API
|
|
|
|
|
|
|
|
The term vectors APIs no longer persist unmapped fields in the mappings.
|
|
|
|
|
|
|
|
The `dfs` parameter to the term vectors API has been removed completely. Term
|
|
|
|
vectors don't support distributed document frequencies anymore.
|
2016-03-24 07:04:31 -04:00
|
|
|
|
|
|
|
==== Sort
|
|
|
|
|
|
|
|
The `reverse` parameter has been removed, in favour of explicitly
|
|
|
|
specifying the sort order with the `order` option.
|
2016-03-23 10:21:35 -04:00
|
|
|
|
2016-04-28 08:13:58 -04:00
|
|
|
The `coerce` and `ignore_malformed` parameters were deprecated in favour of `validation_method`.
|
|
|
|
|
2016-03-23 10:21:35 -04:00
|
|
|
==== Inner hits
|
|
|
|
|
2016-04-18 05:04:25 -04:00
|
|
|
* Top level inner hits syntax has been removed. Inner hits can now only be specified as part of the `nested`,
|
|
|
|
`has_child` and `has_parent` queries. Use cases previously only possible with top level inner hits can now be done
|
|
|
|
with inner hits defined inside the query dsl.
|
2016-05-17 04:58:30 -04:00
|
|
|
|
2016-05-24 16:47:28 -04:00
|
|
|
* Source filtering for inner hits inside nested queries requires full field names instead of relative field names.
|
|
|
|
This is now consistent for source filtering on other places in the search API.
|
|
|
|
|
2016-06-21 07:59:11 -04:00
|
|
|
* Nested inner hits will now no longer include `_index`, `_type` and `_id` keys. For nested inner hits these values
|
|
|
|
are always the same as the `_index`, `_type` and `_id` keys of the root search hit.
|
|
|
|
|
2016-06-22 02:29:50 -04:00
|
|
|
* Parent/child inner hits will now no longer include the `_index` key. For parent/child inner hits the `_index` key is
|
|
|
|
always the same as the the parent search hit.
|
|
|
|
|
2016-05-17 04:58:30 -04:00
|
|
|
==== Query Profiler
|
|
|
|
|
|
|
|
In the response for profiling queries, the `query_type` has been renamed to `type` and `lucene` has been renamed to
|
|
|
|
`description`. These changes have been made so the response format is more friendly to supporting other types of profiling
|
|
|
|
in the future.
|
2016-06-14 21:34:24 -04:00
|
|
|
|
2016-06-17 15:27:46 -04:00
|
|
|
==== Search preferences
|
|
|
|
|
|
|
|
The <<search-request-preference,search preference>> `_only_node` has
|
|
|
|
been removed. The same behavior can be achieved by using `_only_nodes`
|
|
|
|
and specifying a single node ID.
|
2016-06-14 21:34:24 -04:00
|
|
|
|
|
|
|
The <<search-request-preference,search preference>> `_prefer_node` has
|
|
|
|
been superseded by `_prefer_nodes`. By specifying a single node,
|
|
|
|
`_prefer_nodes` provides the same functionality as `_prefer_node` but
|
|
|
|
also supports specifying multiple nodes.
|
2016-06-17 13:08:40 -04:00
|
|
|
|
|
|
|
==== Default similarity
|
|
|
|
|
|
|
|
The default similarity has been changed to `BM25`.
|