search.asciidoc 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. [discrete]
  2. [[breaking_80_search_changes]]
  3. ==== Search Changes
  4. //NOTE: The notable-breaking-changes tagged regions are re-used in the
  5. //Installation and Upgrade Guide
  6. //tag::notable-breaking-changes[]
  7. [[id-field-data]]
  8. .Aggregating and sorting on `_id` is disallowed by default.
  9. [%collapsible]
  10. ====
  11. *Details* +
  12. Previously, it was possible to aggregate and sort on the built-in `_id` field
  13. by loading an expensive data structure called fielddata. This was deprecated
  14. in 7.6 and is now disallowed by default in 8.0.
  15. *Impact* +
  16. Aggregating and sorting on `_id` should be avoided. As an alternative, the
  17. `_id` field's contents can be duplicated into another field with docvalues
  18. enabled (note that this does not apply to auto-generated IDs).
  19. ====
  20. //end::notable-breaking-changes[]
  21. .Search-related REST API endpoints containing mapping types have been removed.
  22. [%collapsible]
  23. ====
  24. *Details* +
  25. The `/{index}/{type}/_search`, `/{index}/{type}/_msearch`, `/{index}/{type}/_search/template` and `/{index}/{type}/_msearch/template` REST endpoints have been removed in favour of `/{index}/_search`, `/{index}/_msearch`, `/{index}/_search/template` and `/{index}/_msearch/template`; since indexes no longer contain types, these typed endpoints are obsolete..
  26. The `/{index}/{type}/_termvectors`, `/{index}/{type}/{id}/_termvectors` and `/{index}/{type}/_mtermvectors` REST endpoints have been removed in favour of `/{index}/_termvectors`, `/{index}/{id}/_termvectors` and `/{index}/_mtermvectors`; since indexes no longer contain types, these typed endpoints are obsolete..
  27. The `/{index}/{type}/{doc}` and `/{index}/{type}/_mget` REST endpoints have been removed in favour of `/{index}/_doc/{doc}` and `/{index}/_mget`; since indexes no longer contain types, these typed endpoints are obsolete.
  28. *Impact* +
  29. Use the replacement REST API endpoints. Requests submitted to API endpoints that
  30. contain a mapping type will return an error.
  31. ====
  32. .The `common` query has been removed.
  33. [%collapsible]
  34. ====
  35. *Details* +
  36. The `common` query, deprecated in 7.x, has been removed in 8.0.
  37. The same functionality can be achieved by the `match` query if the total number of hits is not tracked.
  38. *Impact* +
  39. Discontinue use of the `common` query. Search requests containing a `common`
  40. query will return an error.
  41. ====
  42. .The `cutoff_frequency` parameter has been removed from the `match` and `multi_match` query.
  43. [%collapsible]
  44. ====
  45. *Details* +
  46. The `cutoff_frequency` parameter, deprecated in 7.x, has been removed in 8.0 from `match` and `multi_match` queries.
  47. The same functionality can be achieved without any configuration provided that the total number of hits is not tracked.
  48. *Impact* +
  49. Discontinue use of the `cutoff_frequency` parameter. Search requests containing
  50. this parameter in a `match` or `multi_match` query will return an error.
  51. ====
  52. .The `nested_filter` and `nested_path` properties have been removed from the search API's `sort` request body parameter.
  53. [%collapsible]
  54. ====
  55. *Details* +
  56. The `nested_filter` and `nested_path` options, deprecated in 6.x, have been removed in favor of the `nested` context.
  57. *Impact* +
  58. Discontinue use of the `sort` request body parameter's `nested_filter` and
  59. `nested_path` properties. Requests containing these properties will return an
  60. error.
  61. ====
  62. .Search and get requests are now routed to shards using adaptive replica selection by default.
  63. [%collapsible]
  64. ====
  65. *Details* +
  66. {es} will no longer prefer using shards in the same location (with the same awareness attribute values) to process
  67. `_search` and `_get` requests. Adaptive replica selection (activated by default in this version) will route requests
  68. more efficiently using the service time of prior inter-node communications.
  69. *Impact* +
  70. No action needed.
  71. ====
  72. .The `sparse_vector` field data type has been removed.
  73. [%collapsible]
  74. ====
  75. *Details* +
  76. The `sparse_vector` field type was deprecated in 7.6 and is now removed in
  77. 8.0. We have not seen much interest in this experimental field type, and don't
  78. see a clear use case as it's currently designed. If you have feedback or
  79. suggestions around sparse vector functionality, please let us know through
  80. GitHub or the 'discuss' forums.
  81. *Impact* +
  82. Discontinue use of the `sparse_vector` field data type. Requests containing
  83. a mapping for this field data type will return an error.
  84. ====
  85. .Vector functions using `(query, doc['field'])` are no longer supported.
  86. [%collapsible]
  87. ====
  88. *Details* +
  89. The vector functions of the form `function(query, doc['field'])` were
  90. deprecated in 7.6, and are now removed in 8.x. The form
  91. `function(query, 'field')` should be used instead. For example,
  92. `cosineSimilarity(query, doc['field'])` is replaced by
  93. `cosineSimilarity(query, 'field')`.
  94. *Impact* +
  95. Use the `function(query, 'field')` form. Discontinue use of the `function(query,
  96. doc['field'])` form. Requests containing the `function(query,
  97. doc['field'])` form will return an error.
  98. ====
  99. .The search API's `indices_boost` request body parameter no longer accepts object values.
  100. [%collapsible]
  101. ====
  102. *Details* +
  103. The `indices_boost` option in the search request used to accept the boosts
  104. both as an object and as an array. The object format has been deprecated since
  105. 5.2 and is now removed in 8.0.
  106. *Impact* +
  107. Use only array values in the `indices_boost` parameter. Requests containing an
  108. object value in the `indices_boost` parameter will return an error.
  109. ====
  110. .The search API's `use_field_mapping` request body parameter has been removed.
  111. [%collapsible]
  112. ====
  113. *Details* +
  114. In 7.0, we began formatting `docvalue_fields` by default using each field's
  115. mapping definition. To ease the transition from 6.x, we added the format
  116. option `use_field_mapping`. This parameter was deprecated in 7.0, and is now
  117. removed in 8.0.
  118. *Impact* +
  119. Discontinue use of the `use_field_mapping` request body parameter. Requests
  120. containing this parameter will return an error.
  121. ====
  122. .The search API's `from` request body and url parameter cannot be negative.
  123. [%collapsible]
  124. ====
  125. *Details* +
  126. Search request used to accept `-1` as a `from` in the search body and the url,
  127. treating it as the default value of 0. Other negative values got rejected with
  128. an error already. We now also reject `-1` as an invalid value.
  129. *Impact* +
  130. Change any use of `-1` as `from` parameter in request body or url parameters by either
  131. setting it to `0` or omitting it entirely. Requests containing negative values will
  132. return an error.
  133. ====
  134. .Range queries on date fields treat numeric values alwas as milliseconds-since-epoch.
  135. [%collapsible]
  136. ====
  137. *Details* +
  138. Range queries on date fields used to misinterpret small numbers (e.g. four digits like 1000)
  139. as a year when no additional format was set, but would interpret other numeric values as
  140. milliseconds since epoch. We now treat all numeric values in absence of a specific `format`
  141. parameter as milliseconds since epoch. If you want to query for years instead, with a missing
  142. `format` you now need to quote the input value (e.g. "1984").
  143. *Impact* +
  144. If you query date fields without a specified `format`, check if the values in your queries are
  145. actually meant to be milliseconds-since-epoch and use a numeric value in this case. If not, use
  146. a string value which gets parsed by either the date format set on the field in the mappings or
  147. by `strict_date_optional_time` by default.
  148. ====