search.asciidoc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. [[breaking_50_search_changes]]
  2. === Search and Query DSL changes
  3. ==== `search_type`
  4. ===== `search_type=count` removed
  5. The `count` search type was deprecated since version 2.0.0 and is now removed.
  6. In order to get the same benefits, you just need to set the value of the `size`
  7. parameter to `0`.
  8. For instance, the following request:
  9. [source,sh]
  10. ---------------
  11. GET /my_index/_search?search_type=count
  12. {
  13. "aggs": {
  14. "my_terms": {
  15. "terms": {
  16. "field": "foo"
  17. }
  18. }
  19. }
  20. }
  21. ---------------
  22. can be replaced with:
  23. [source,sh]
  24. ---------------
  25. GET /my_index/_search
  26. {
  27. "size": 0,
  28. "aggs": {
  29. "my_terms": {
  30. "terms": {
  31. "field": "foo"
  32. }
  33. }
  34. }
  35. }
  36. ---------------
  37. ===== `search_type=scan` removed
  38. The `scan` search type was deprecated since version 2.1.0 and is now removed.
  39. All benefits from this search type can now be achieved by doing a scroll
  40. request that sorts documents in `_doc` order, for instance:
  41. [source,sh]
  42. ---------------
  43. GET /my_index/_search?scroll=2m
  44. {
  45. "sort": [
  46. "_doc"
  47. ]
  48. }
  49. ---------------
  50. Scroll requests sorted by `_doc` have been optimized to more efficiently resume
  51. from where the previous request stopped, so this will have the same performance
  52. characteristics as the former `scan` search type.
  53. ==== `fields` parameter
  54. The `fields` parameter used to try to retrieve field values from stored
  55. fields, and fall back to extracting from the `_source` if a field is not
  56. marked as stored. Now, the `fields` parameter will only return stored fields
  57. -- it will no longer extract values from the `_source`.
  58. ==== search-exists API removed
  59. The search exists api has been removed in favour of using the search api with
  60. `size` set to `0` and `terminate_after` set to `1`.
  61. ==== Deprecated queries removed
  62. The following deprecated queries have been removed:
  63. `filtered`:: Use `bool` query instead, which supports `filter` clauses too.
  64. `and`:: Use `must` clauses in a `bool` query instead.
  65. `or`:: Use `should` clauses in a `bool` query instead.
  66. `limit`:: Use the `terminate_after` parameter instead.
  67. `fquery`:: Is obsolete after filters and queries have been merged.
  68. `query`:: Is obsolete after filters and queries have been merged.
  69. `query_binary`:: Was undocumented and has been removed.
  70. `filter_binary`:: Was undocumented and has been removed.
  71. ==== Changes to queries
  72. * Removed support for the deprecated `min_similarity` parameter in `fuzzy
  73. query`, in favour of `fuzziness`.
  74. * Removed support for the deprecated `fuzzy_min_sim` parameter in
  75. `query_string` query, in favour of `fuzziness`.
  76. * Removed support for the deprecated `edit_distance` parameter in completion
  77. suggester, in favour of `fuzziness`.
  78. * Removed support for the deprecated `filter` and `no_match_filter` fields in `indices` query,
  79. in favour of `query` and `no_match_query`.
  80. * Removed support for the deprecated `filter` fields in `nested` query, in favour of `query`.
  81. * Removed support for the deprecated `minimum_should_match` and
  82. `disable_coord` in `terms` query, use `bool` query instead. Also removed
  83. support for the deprecated `execution` parameter.
  84. * Removed support for the top level `filter` element in `function_score` query, replaced by `query`.
  85. * The `collect_payloads` parameter of the `span_near` query has been deprecated. Payloads will be loaded when needed.
  86. * The `score_type` parameter to the `nested` and `has_child` queries has been
  87. removed in favour of `score_mode`. The `score_mode` parameter to `has_parent`
  88. has been deprecated in favour of the `score` boolean parameter. Also, the
  89. `total` score mode has been removed in favour of the `sum` mode.
  90. * When the `max_children` parameter was set to `0` on the `has_child` query
  91. then there was no upper limit on how many child documents were allowed to
  92. match. Now, `0` really means that zero child documents are allowed. If no
  93. upper limit is needed then the `max_children` parameter shouldn't be specified
  94. at all.
  95. * The `exists` query will now fail if the `_field_names` field is disabled.
  96. ==== Top level `filter` parameter
  97. Removed support for the deprecated top level `filter` in the search api,
  98. replaced by `post_filter`.
  99. ==== Highlighters
  100. Removed support for multiple highlighter names, the only supported ones are:
  101. `plain`, `fvh` and `postings`.
  102. ==== Term vectors API
  103. The term vectors APIs no longer persist unmapped fields in the mappings.
  104. The `dfs` parameter to the term vectors API has been removed completely. Term
  105. vectors don't support distributed document frequencies anymore.
  106. ==== Sort
  107. The `reverse` parameter has been removed, in favour of explicitly
  108. specifying the sort order with the `order` option.
  109. ==== Inner hits
  110. * Top level inner hits syntax has been removed. Inner hits can now only be specified as part of the `nested`,
  111. `has_child` and `has_parent` queries. Use cases previously only possible with top level inner hits can now be done
  112. with inner hits defined inside the query dsl.