search.asciidoc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. [float]
  2. [[breaking_70_search_changes]]
  3. === Search and Query DSL changes
  4. [float]
  5. ==== Changes to queries
  6. * The default value for `transpositions` parameter of `fuzzy` query
  7. has been changed to `true`.
  8. * The `query_string` options `use_dismax`, `split_on_whitespace`,
  9. `all_fields`, `locale`, `auto_generate_phrase_query` and
  10. `lowercase_expanded_terms` deprecated in 6.x have been removed.
  11. * Purely negative queries (only MUST_NOT clauses) now return a score of `0`
  12. rather than `1`.
  13. * The boundary specified using geohashes in the `geo_bounding_box` query
  14. now include entire geohash cell, instead of just geohash center.
  15. * Attempts to generate multi-term phrase queries against non-text fields
  16. with a custom analyzer will now throw an exception.
  17. * An `envelope` crossing the dateline in a `geo_shape `query is now processed
  18. correctly when specified using REST API instead of having its left and
  19. right corners flipped.
  20. * Attempts to set `boost` on inner span queries will now throw a parsing exception.
  21. [float]
  22. ==== Adaptive replica selection enabled by default
  23. Adaptive replica selection has been enabled by default. If you wish to return to
  24. the older round robin of search requests, you can use the
  25. `cluster.routing.use_adaptive_replica_selection` setting:
  26. [source,js]
  27. --------------------------------------------------
  28. PUT /_cluster/settings
  29. {
  30. "transient": {
  31. "cluster.routing.use_adaptive_replica_selection": false
  32. }
  33. }
  34. --------------------------------------------------
  35. // CONSOLE
  36. [float]
  37. ==== Search API returns `400` for invalid requests
  38. The Search API returns `400 - Bad request` while it would previously return
  39. `500 - Internal Server Error` in the following cases of invalid request:
  40. * the result window is too large
  41. * sort is used in combination with rescore
  42. * the rescore window is too large
  43. * the number of slices is too large
  44. * keep alive for scroll is too large
  45. * number of filters in the adjacency matrix aggregation is too large
  46. * script compilation errors
  47. [float]
  48. ==== Scroll queries cannot use the `request_cache` anymore
  49. Setting `request_cache:true` on a query that creates a scroll (`scroll=1m`)
  50. has been deprecated in 6 and will now return a `400 - Bad request`.
  51. Scroll queries are not meant to be cached.
  52. [float]
  53. ==== Scroll queries cannot use `rescore` anymore
  54. Including a rescore clause on a query that creates a scroll (`scroll=1m`) has
  55. been deprecated in 6.5 and will now return a `400 - Bad request`. Allowing
  56. rescore on scroll queries would break the scroll sort. In the 6.x line, the
  57. rescore clause was silently ignored (for scroll queries), and it was allowed in
  58. the 5.x line.
  59. [float]
  60. ==== Term Suggesters supported distance algorithms
  61. The following string distance algorithms were given additional names in 6.2 and
  62. their existing names were deprecated. The deprecated names have now been
  63. removed.
  64. * `levenstein` - replaced by `levenshtein`
  65. * `jarowinkler` - replaced by `jaro_winkler`
  66. [float]
  67. ==== `popular` mode for Suggesters
  68. The `popular` mode for Suggesters (`term` and `phrase`) now uses the doc frequency
  69. (instead of the sum of the doc frequency) of the input terms to compute the frequency
  70. threshold for candidate suggestions.
  71. [float]
  72. ==== Limiting the number of terms that can be used in a Terms Query request
  73. Executing a Terms Query with a lot of terms may degrade the cluster performance,
  74. as each additional term demands extra processing and memory.
  75. To safeguard against this, the maximum number of terms that can be used in a
  76. Terms Query request has been limited to 65536. This default maximum can be changed
  77. for a particular index with the index setting `index.max_terms_count`.
  78. [float]
  79. ==== Limiting the length of regex that can be used in a Regexp Query request
  80. Executing a Regexp Query with a long regex string may degrade search performance.
  81. To safeguard against this, the maximum length of regex that can be used in a
  82. Regexp Query request has been limited to 1000. This default maximum can be changed
  83. for a particular index with the index setting `index.max_regex_length`.
  84. [float]
  85. ==== Limiting the number of auto-expanded fields
  86. Executing queries that use automatic expansion of fields (e.g. `query_string`, `simple_query_string`
  87. or `multi_match`) can have performance issues for indices with a large numbers of fields.
  88. To safeguard against this, a hard limit of 1024 fields has been introduced for queries
  89. using the "all fields" mode ("default_field": "*") or other fieldname expansions (e.g. "foo*").
  90. [float]
  91. ==== Invalid `_search` request body
  92. Search requests with extra content after the main object will no longer be accepted
  93. by the `_search` endpoint. A parsing exception will be thrown instead.
  94. [float]
  95. ==== Context Completion Suggester
  96. The ability to query and index context enabled suggestions without context,
  97. deprecated in 6.x, has been removed. Context enabled suggestion queries
  98. without contexts have to visit every suggestion, which degrades the search performance
  99. considerably.
  100. For geo context the value of the `path` parameter is now validated against the mapping,
  101. and the context is only accepted if `path` points to a field with `geo_point` type.
  102. [float]
  103. ==== Semantics changed for `max_concurrent_shard_requests`
  104. `max_concurrent_shard_requests` used to limit the total number of concurrent shard
  105. requests a single high level search request can execute. In 7.0 this changed to be the
  106. max number of concurrent shard requests per node. The default is now `5`.
  107. [float]
  108. ==== `max_score` set to `null` when scores are not tracked
  109. `max_score` used to be set to `0` whenever scores are not tracked. `null` is now used
  110. instead which is a more appropriate value for a scenario where scores are not available.
  111. [float]
  112. ==== Negative boosts are not allowed
  113. Setting a negative `boost` in a query, deprecated in 6x, are not allowed in this version.
  114. To deboost a specific query you can use a `boost` comprise between 0 and 1.
  115. [float]
  116. ==== Negative scores are not allowed in Function Score Query
  117. Negative scores in the Function Score Query are deprecated in 6.x, and are
  118. not allowed in this version. If a negative score is produced as a result
  119. of computation (e.g. in `script_score` or `field_value_factor` functions),
  120. an error will be thrown.
  121. [float]
  122. ==== The filter context has been removed
  123. The `filter` context has been removed from Elasticsearch's query builders,
  124. the distinction between queries and filters is now decided in Lucene depending
  125. on whether queries need to access score or not. As a result `bool` queries with
  126. `should` clauses that don't need to access the score will no longer set their
  127. `minimum_should_match` to 1. This behavior has been deprecated in the previous
  128. major version.