rest-api-changes.asciidoc 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  1. [discrete]
  2. [[breaking_80_rest_api_changes]]
  3. ==== REST API 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. .REST API endpoints containing `_xpack` have been removed.
  8. [%collapsible]
  9. ====
  10. *Details* +
  11. In 7.0, we deprecated REST endpoints that contain `_xpack` in their path. These
  12. endpoints are now removed in 8.0. Each endpoint that was deprecated and removed
  13. is replaced with a new endpoint that does not contain `_xpack`. As an example,
  14. `/{index}/_xpack/graph/_explore` is replaced by `/{index}/_graph/explore`.
  15. *Impact* +
  16. Use the replacement REST API endpoints. Requests submitted to the `_xpack`
  17. API endpoints will return an error.
  18. *Compatibility* +
  19. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  20. {ref}/rest-api-compatibility.html[requested], any requests that include
  21. the`_xpack` prefix are rerouted to the corresponding URL without the `_xpack`
  22. prefix.
  23. ====
  24. [[remove-mapping-type-api-endpoints]]
  25. .REST API endpoints containing mapping types have been removed.
  26. [%collapsible]
  27. ====
  28. *Details* +
  29. Mapping types have been removed. API endpoints that contain a mapping type have
  30. also been removed. Use a typeless endpoint instead.
  31. [options="header",cols="<1,<3,<1"]
  32. |====
  33. | API | Typed API endpoint | Typeless API endpoint
  34. | {ref}/docs-bulk.html[Bulk]
  35. | `<target>/<type>/_bulk`
  36. | `<target>/_bulk`
  37. | {ref}/search-count.html[Count]
  38. | `<target>/<type>/_count`
  39. | `<target>/_count`
  40. | {ref}/docs-delete.html[Delete]
  41. | `<index>/<type>/<_id>`
  42. | `<index>/_doc/<_id>`
  43. | {ref}/docs-delete-by-query.html[Delete by query]
  44. | `<target>/<type>/_delete_by_query`
  45. | `<target>/_delete_by_query`
  46. | {ref}/search-explain.html[Explain]
  47. | `<index>/<type>/<_id>/_explain`
  48. | `<index>/_explain/<_id>`
  49. | {ref}/docs-get.html[Get]
  50. | `<index>/<type>/<_id>`
  51. | `<index>/_doc/<_id>`
  52. |
  53. | `<index>/<type>/<_id>/_source`
  54. | `<index>/_source/<_id>`
  55. | {ref}/indices-get-field-mapping.html[Get field mapping]
  56. | `_mapping/<type>/field/<field>`
  57. | `_mapping/field/<field>`
  58. |
  59. | `<target>/_mapping/<type>/field/<field>`
  60. | `<target>/_mapping/field/<field>`
  61. | {ref}/indices-get-mapping.html[Get mapping]
  62. | `_mapping/<type>`
  63. | `_mapping` or `<target>/_mapping`
  64. |
  65. | `<target>/<type>/_mapping`
  66. | `<target>/_mapping`
  67. |
  68. | `<target>/_mapping/<type>`
  69. | `<target>/_mapping`
  70. | {ref}/graph-explore-api.html[Graph explore]
  71. | `<index>/<type>/_graph/explore`
  72. | `<index>/_graph/explore`
  73. | {ref}/docs-index_.html[Index]
  74. | `<target>/<type>/<_id>/_create`
  75. | `<target>/_create/<_id>`
  76. |
  77. | `<target>/<type>`
  78. | `<target>/_doc`
  79. |
  80. | `<target>/<type>/<_id>`
  81. | `<target>/_doc/<_id>`
  82. | {ref}/docs-multi-get.html[Multi get]
  83. | `<index>/<type>/_mget`
  84. | `<index>/_mget`
  85. | {ref}/search-multi-search.html[Multi search]
  86. | `<target>/<type>/_msearch`
  87. | `<target>/_msearch`
  88. | {ref}/multi-search-template.html[Multi search template]
  89. | `<target>/<type>/_msearch/template`
  90. | `<target>/_msearch/template`
  91. | {ref}/docs-multi-termvectors.html[Multi term vectors]
  92. | `<index>/<type>/_mtermvectors`
  93. | `<index>/_mtermvectors`
  94. | {ref}/rollup-search.html[Rollup search]
  95. | `<target>/<type>/_rollup_search`
  96. | `<target>/_rollup_search`
  97. | {ref}/search-search.html[Search]
  98. | `<target>/<type>/_search`
  99. | `<target>/_search`
  100. | {ref}/search-template-api.html[Search template]
  101. | `<target>/<type>/_search/template`
  102. | `<target>/_search/template`
  103. | {ref}/docs-termvectors.html[Term vectors]
  104. | `<index>/<mapping_type>/<_id>/_termvectors`
  105. | `<index>/_termvectors<_id>`
  106. |
  107. | `<index>/<mapping_type>/_termvectors`
  108. | `<index>/_termvectors`
  109. | {ref}/docs-update.html[Update]
  110. | `<index>/<type>/<_id>/_update`
  111. | `<index>/_update/<_id>`
  112. | {ref}/docs-update-by-query.html[Update by query]
  113. | `<target>/<type>/_update_by_query`
  114. | `<target>/_update_by_query`
  115. | {ref}/indices-put-mapping.html[Update mapping]
  116. | `<target>/<type>/_mapping`
  117. | `<target>/_mapping`
  118. |
  119. | `<target>/_mapping/<type>`
  120. | `<target>/_mapping`
  121. |
  122. | `_mapping/<type>`
  123. | `<target>/_mapping`
  124. | {ref}/search-validate.html[Validate]
  125. | `<target>/<type>/_validate/query`
  126. | `<target>/_validate/query`
  127. |====
  128. *Impact* +
  129. Update your application to use typeless REST API endpoints. Requests to
  130. endpoints that contain a mapping type will return an error.
  131. *Compatibility* +
  132. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  133. {ref}/rest-api-compatibility.html[requested], if a request includes a custom
  134. mapping type it is ignored. The request is rerouted to the corresponding
  135. typeless URL. Custom mapping types in request bodies and type related HTTP
  136. parameters are ignored, and responses, where warranted, include `_type` :
  137. `_doc`.
  138. ====
  139. .{ccs-cap} ({ccs-init}) is now only backward-compatible with the previous minor version.
  140. [%collapsible]
  141. ====
  142. *Details* +
  143. In 8.0+, Elastic supports searches from a local cluster to a remote cluster
  144. running:
  145. * The previous minor version.
  146. * The same version.
  147. * A newer minor version in the same major version.
  148. Elastic also supports searches from a local cluster running the last minor
  149. version of a major version to a remote cluster running any minor version in the
  150. following major version. For example, a local 7.17 cluster can search any
  151. remote 8.x cluster.
  152. include::{es-repo-dir}/search/search-your-data/ccs-version-compat-matrix.asciidoc[]
  153. IMPORTANT: For the {ref}/eql-search-api.html[EQL search API], the local and
  154. remote clusters must use the same {es} version if they have versions prior to 7.17.7 (included) or prior to 8.5.1 (included).
  155. For example, a local 8.0 cluster can search a remote 7.17 or any remote 8.x
  156. cluster. However, a search from a local 8.0 cluster to a remote 7.16 or 6.8
  157. cluster is not supported.
  158. Previously, we also supported searches on remote clusters running:
  159. * Any minor version of the local cluster's major version.
  160. * The last minor release of the previous major version.
  161. However, such searches can result in undefined behavior.
  162. *Impact* +
  163. If you only run cross-cluster searches on remote clusters using the same or a
  164. newer version, no changes are needed.
  165. If you previously searched remote clusters running an earlier version of {es},
  166. see {ref}/modules-cross-cluster-search.html#ensure-ccs-support[Ensure {ccs}
  167. support] for recommended solutions.
  168. A {ccs} using an unsupported configuration may still work. However, such
  169. searches aren't tested by Elastic, and their behavior isn't guaranteed.
  170. ====
  171. [[remove-term-order-key]]
  172. .The `terms` aggregation no longer supports the `_term` order key.
  173. [%collapsible]
  174. ====
  175. *Details* +
  176. The `terms` aggregation no longer supports the `_term` key in `order` values. To
  177. sort buckets by their term, use `_key` instead.
  178. *Impact* +
  179. Discontinue use of the `_term` order key. Requests that include a `_term` order
  180. key will return an error.
  181. *Compatibility* +
  182. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  183. {ref}/rest-api-compatibility.html[requested], the `_term` order is ignored and
  184. `key` is used instead.
  185. ====
  186. [[remove-time-order-key]]
  187. .The `date_histogram` aggregation no longer supports the `_time` order key.
  188. [%collapsible]
  189. ====
  190. *Details* +
  191. The `date_histogram` aggregation no longer supports the `_time` key in `order`
  192. values. To sort buckets by their key, use `_key` instead.
  193. *Impact* +
  194. Discontinue use of the `_time` order key. Requests that include a `_time` order
  195. key will return an error.
  196. *Compatibility* +
  197. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  198. {ref}/rest-api-compatibility.html[requested], the `_time` order is ignored and
  199. `_key` is used instead.
  200. ====
  201. [[remove-moving-avg-agg]]
  202. .The `moving_avg` aggregation has been removed.
  203. [%collapsible]
  204. ====
  205. *Details* +
  206. The `moving_avg` aggregation was deprecated in 6.4 and has been removed. To
  207. calculate moving averages, use the
  208. {ref}/search-aggregations-pipeline-movfn-aggregation.html[`moving_fn`
  209. aggregation] instead.
  210. *Impact* +
  211. Discontinue use of the `moving_avg` aggregation. Requests that include the
  212. `moving_avg` aggregation will return an error.
  213. ====
  214. [[percentile-duplication]]
  215. .The `percentiles` aggregation's `percents` parameter no longer supports duplicate values.
  216. [%collapsible]
  217. ====
  218. *Details* +
  219. If you specify the `percents` parameter with the
  220. {ref}/search-aggregations-metrics-percentile-aggregation.html[`percentiles` aggregation],
  221. its values must be unique. Otherwise, an exception occurs.
  222. *Impact* +
  223. Use unique values in the `percents` parameter of the `percentiles` aggregation.
  224. Requests containing duplicate values in the `percents` parameter will return
  225. an error.
  226. ====
  227. [[date-histogram-interval]]
  228. .The `date_histogram` aggregation's `interval` parameter is no longer valid.
  229. [%collapsible]
  230. ====
  231. *Details* +
  232. It is now an error to specify the `interval` parameter to the
  233. {ref}/search-aggregations-bucket-datehistogram-aggregation.html[`date_histogram`
  234. aggregation] or the
  235. {ref}/search-aggregations-bucket-composite-aggregation.html#_date_histogram[`composite
  236. date_histogram` source. Instead, please use either `calendar_interval` or
  237. `fixed_interval` as appropriate.
  238. *Impact* +
  239. Uses of the `interval` parameter in either the `date_histogram` aggregation or
  240. the `date_histogram` composite source will now generate an error. Instead
  241. please use the more specific `fixed_interval` or `calendar_interval`
  242. parameters.
  243. *Compatibility* +
  244. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  245. {ref}/rest-api-compatibility.html[requested], the `interval` parameter is
  246. adapted to either a fixed or calendar interval.
  247. ====
  248. [[ngram-edgengram-filter-names-removed]]
  249. .The `nGram` and `edgeNGram` token filter names have been removed.
  250. [%collapsible]
  251. ====
  252. *Details* +
  253. The `nGram` and `edgeNGram` token filter names that have been deprecated since
  254. version 6.4 have been removed. Both token filters can only be used by their
  255. alternative names `ngram` and `edge_ngram` since version 7.0.
  256. *Impact* +
  257. Use the equivalent `ngram` and `edge_ngram` token filters. Requests containing
  258. the `nGram` and `edgeNGram` token filter names will return an error.
  259. ====
  260. [[nGram-edgeNGram-tokenizer-dreprecation]]
  261. .The `nGram` and `edgeNGram` tokenizer names have been removed.
  262. [%collapsible]
  263. ====
  264. *Details* +
  265. The `nGram` and `edgeNGram` tokenizer names haven been deprecated with 7.6 and are no longer
  266. supported on new indices. Mappings for indices created after 7.6 will continue to work but
  267. emit a deprecation warning. The tokenizer name should be changed to the fully equivalent
  268. `ngram` or `edge_ngram` names for new indices and in index templates.
  269. *Impact* +
  270. Use the `ngram` and `edge_ngram` tokenizers. Requests to create new indices
  271. using the `nGram` and `edgeNGram` tokenizer names will return an error.
  272. ====
  273. .The `in_flight_requests` stat has been renamed `inflight_requests` in logs and diagnostic APIs.
  274. [%collapsible]
  275. ====
  276. *Details* +
  277. The name of the in flight requests circuit breaker in log output and diagnostic APIs (such as the node stats API) changes from `in_flight_requests` to `inflight_requests` to align it with the name of the corresponding settings.
  278. *Impact* +
  279. Update your workflow and applications to use the `inflight_requests` stat in
  280. place of `in_flight_requests`.
  281. ====
  282. .The voting configuration exclusions API endpoint has changed.
  283. [%collapsible]
  284. ====
  285. *Details* +
  286. The `POST /_cluster/voting_config_exclusions/{node_filter}` API has been
  287. removed in favour of `POST /_cluster/voting_config_exclusions?node_names=...`
  288. and `POST /_cluster/voting_config_exclusions?node_ids=...` which allow you to
  289. specify the names or IDs of the nodes to exclude.
  290. *Impact* +
  291. Use `POST /_cluster/voting_config_exclusions?node_ids=...` and specify the nodes
  292. to exclude instead of using a node filter. Requests submitted to the
  293. `/_cluster/voting_config_exclusions/{node_filter}` endpoint will return an
  294. error.
  295. ====
  296. .Remote system indices are not followed automatically if they match an auto-follow pattern.
  297. [%collapsible]
  298. ====
  299. *Details* +
  300. Remote system indices matching an {ref}/ccr-auto-follow.html[auto-follow
  301. pattern] won't be configured as a follower index automatically.
  302. *Impact* +
  303. Explicitly {ref}/ccr-put-follow.html[create a follower index] to follow a remote
  304. system index if that's the wanted behaviour.
  305. ====
  306. .The EQL `wildcard` function has been removed.
  307. [%collapsible]
  308. ====
  309. *Details* +
  310. The `wildcard` function was deprecated in {es} 7.13.0 and has been removed.
  311. *Impact* +
  312. Use the `like` or `regex` {ref}/eql-syntax.html#eql-syntax-pattern-comparison-keywords[keywords] instead.
  313. ====
  314. [[ilm-freeze-noop]]
  315. .The ILM `freeze` action is now a no-op.
  316. [%collapsible]
  317. ====
  318. *Details* +
  319. The ILM freeze action is now a no-op and performs no action on the index, as the freeze API endpoint
  320. has been removed in 8.0.
  321. *Impact* +
  322. Update your ILM policies to remove the `freeze` action from the `cold` phase.
  323. ====
  324. [[ilm-policy-validation]]
  325. .Additional validation for ILM policies.
  326. [%collapsible]
  327. ====
  328. *Details* +
  329. Creating or updating an ILM policy now requires that any referenced snapshot repositories and SLM
  330. policies exist.
  331. *Impact* +
  332. Update your code or configuration management to ensure that repositories and SLM policies are created
  333. before any policies that reference them.
  334. ====
  335. .The deprecated `_upgrade` API has been removed.
  336. [%collapsible]
  337. ====
  338. *Details* +
  339. Previously, the `_upgrade` API upgraded indices from the previous major
  340. version to the current version. The `_reindex` API should be used
  341. instead for that purpose.
  342. *Impact* +
  343. Requests made to the old `_upgrade` API will return an error.
  344. ====
  345. .The deprecated freeze index API has been removed.
  346. [%collapsible]
  347. ====
  348. *Details* +
  349. The freeze index API (`POST /<index>/_freeze`) has been removed.
  350. https://www.elastic.co/blog/significantly-decrease-your-elasticsearch-heap-memory-usage[Improvements
  351. in heap memory usage] have eliminated the reason to freeze indices.
  352. You can still unfreeze existing frozen indices using the
  353. {ref}/unfreeze-index-api.html[unfreeze index API]. For some use cases, the
  354. frozen tier may be a suitable replacement for frozen indices. See
  355. {ref}/data-tiers.html[data tiers] for more information.
  356. *Impact* +
  357. Requests made to the old freeze index API will return an error.
  358. ====
  359. .The force merge API's `max_num_segments` and `only_expunge_deletes` parameters cannot both be specified in the same request.
  360. [%collapsible]
  361. ====
  362. *Details* +
  363. Previously, the force merge API allowed the parameters `only_expunge_deletes`
  364. and `max_num_segments` to be set to a non default value at the same time. But
  365. the `max_num_segments` was silently ignored when `only_expunge_deletes` is set
  366. to `true`, leaving the false impression that it has been applied.
  367. *Impact* +
  368. When using the {ref}/indices-forcemerge.html[force merge API], do not specify
  369. values for both the `max_num_segments` and `only_expunge_deletes` parameters.
  370. Requests that include values for both parameters will return an error.
  371. ====
  372. .The create or update index template API's `template` parameter has been removed.
  373. [%collapsible]
  374. ====
  375. *Details* +
  376. In 6.0, we deprecated the `template` parameter in create or update index
  377. template requests in favor of using `index_patterns`. Support for the `template`
  378. parameter is now removed in 8.0.
  379. *Impact* +
  380. Use the {ref}/indices-templates-v1.html[create or update index template API]'s
  381. `index_patterns` parameter. Requests that include the `template` parameter will
  382. return an error.
  383. *Compatibility* +
  384. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  385. {ref}/rest-api-compatibility.html[requested], the `template` parameter is mapped
  386. to `index_patterns`.
  387. ====
  388. .Synced flush has been removed.
  389. [%collapsible]
  390. ====
  391. *Details* +
  392. Synced flush was deprecated in 7.6 and is removed in 8.0. Use a regular flush
  393. instead as it has the same effect as a synced flush in 7.6 and later.
  394. *Impact* +
  395. Use the {ref}/indices-flush.html[flush API]. Requests to the
  396. `/<index>/flush/synced` or `/flush/synced` endpoints will return an error.
  397. *Compatibility* +
  398. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  399. {ref}/rest-api-compatibility.html[requested], the request to synced flush is
  400. routed to the equivalent non-synced flush URL.
  401. ====
  402. .The default for the `?wait_for_active_shards` parameter on the close index API has changed.
  403. [%collapsible]
  404. ====
  405. *Details* +
  406. When closing an index in earlier versions, by default {es} would not wait for
  407. the shards of the closed index to be properly assigned before returning. From
  408. version 8.0 onwards the default behaviour is to wait for shards to be assigned
  409. according to the
  410. {ref}/docs-index_.html#index-wait-for-active-shards[`index.write.wait_for_active_shards`
  411. index setting].
  412. *Impact* +
  413. Accept the new behaviour, or specify `?wait_for_active_shards=0` to preserve
  414. the old behaviour if needed.
  415. ====
  416. .The index stats API's `types` query parameter has been removed.
  417. [%collapsible]
  418. ====
  419. *Details* +
  420. The index stats API's `types` query parameter has been removed. Previously, you
  421. could combine `types` with the `indexing` query parameter to return indexing
  422. stats for specific mapping types. Mapping types have been removed in 8.0.
  423. *Impact* +
  424. Discontinue use of the `types` query parameter. Requests that include the
  425. parameter will return an error.
  426. *Compatibility* +
  427. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  428. {ref}/rest-api-compatibility.html[requested], the `types` query parameter is
  429. ignored and stats are returned for the entire index.
  430. ====
  431. .The `user_agent` ingest processor's `ecs` parameter has no effect.
  432. [%collapsible]
  433. ====
  434. *Details* +
  435. In 7.2, we deprecated the `ecs` parameter for the `user_agent` ingest processor.
  436. In 8.x, the `user_agent` ingest processor will only return {ecs-ref}[Elastic
  437. Common Schema (ECS)] fields, regardless of the `ecs` value.
  438. *Impact* +
  439. To avoid deprecation warnings, remove the parameter from your ingest pipelines.
  440. If a pipeline specifies an `ecs` value, the value is ignored.
  441. ====
  442. .The `include_type_name` query parameter has been removed.
  443. [%collapsible]
  444. ====
  445. *Details* +
  446. The `include_type_name` query parameter has been removed from the index
  447. creation, index template, and mapping APIs. Previously, you could set
  448. `include_type_name` to `true` to indicate that requests and responses should
  449. include a mapping type name. Mapping types have been removed in 8.x.
  450. *Impact* +
  451. Discontinue use of the `include_type_name` query parameter. Requests that
  452. include the parameter will return an error.
  453. *Compatibility* +
  454. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  455. {ref}/rest-api-compatibility.html[requested], the `include_type_name` query
  456. parameter is ignored and any custom mapping types in the request are removed.
  457. ====
  458. .Reindex from remote now re-encodes URL-encoded index names.
  459. [%collapsible]
  460. ====
  461. *Details* +
  462. Reindex from remote would previously allow URL-encoded index names and not
  463. re-encode them when generating the search request for the remote host. This
  464. leniency has been removed such that all index names are correctly encoded when
  465. reindex generates remote search requests.
  466. *Impact* +
  467. Specify unencoded index names for reindex from remote requests.
  468. ====
  469. .In the reindex, delete by query, and update by query APIs, the `size` parameter has been renamed.
  470. [%collapsible]
  471. ====
  472. *Details* +
  473. Previously, a `_reindex` request had two different size specifications in the body:
  474. - Outer level, determining the maximum number of documents to process
  475. - Inside the `source` element, determining the scroll/batch size.
  476. The outer level `size` parameter has now been renamed to `max_docs` to
  477. avoid confusion and clarify its semantics.
  478. Similarly, the `size` parameter has been renamed to `max_docs` for
  479. `_delete_by_query` and `_update_by_query` to keep the 3 interfaces consistent.
  480. *Impact* +
  481. Use the replacement parameters. Requests containing the `size` parameter will
  482. return an error.
  483. *Compatibility* +
  484. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  485. {ref}/rest-api-compatibility.html[requested], the `size` parameter is mapped to
  486. the `max_docs` parameter.
  487. ====
  488. .The update by query API now rejects unsupported `script` fields.
  489. [%collapsible]
  490. ====
  491. *Details* +
  492. An update by query API request that includes an unsupported field in the
  493. `script` object now returns an error. Previously, the API would silently ignore
  494. these unsupported fields.
  495. *Impact* +
  496. To avoid errors, remove unsupported fields from the `script` object.
  497. ====
  498. .The cat node API's `local` query parameter has been removed.
  499. [%collapsible]
  500. ====
  501. *Details* +
  502. The `?local` parameter to the `GET _cat/nodes` API was deprecated in 7.x and is
  503. rejected in 8.0. This parameter caused the API to use the local cluster state
  504. to determine the nodes returned by the API rather than the cluster state from
  505. the master, but this API requests information from each selected node
  506. regardless of the `?local` parameter which means this API does not run in a
  507. fully node-local fashion.
  508. *Impact* +
  509. Discontinue use of the `?local` query parameter. {ref}/cat-nodes.html[cat node
  510. API] requests that include this parameter will return an error.
  511. ====
  512. .The cat shard API's `local` query parameter has been removed.
  513. [%collapsible]
  514. ====
  515. *Details* +
  516. The `?local` parameter to the `GET _cat/shards` API was deprecated in 7.x and is
  517. rejected in 8.0. This parameter caused the API to use the local cluster state
  518. to determine the nodes returned by the API rather than the cluster state from
  519. the master, but this API requests information from each selected node
  520. regardless of the `?local` parameter which means this API does not run in a
  521. fully node-local fashion.
  522. *Impact* +
  523. Discontinue use of the `?local` query parameter. {ref}/cat-shards.html[cat shards
  524. API] requests that include this parameter will return an error.
  525. ====
  526. .The cat indices API's `local` query parameter has been removed.
  527. [%collapsible]
  528. ====
  529. *Details* +
  530. The `?local` parameter to the `GET _cat/indices` API was deprecated in 7.x and is
  531. rejected in 8.0. This parameter caused the API to use the local cluster state
  532. to determine the nodes returned by the API rather than the cluster state from
  533. the master, but this API requests information from each selected node
  534. regardless of the `?local` parameter which means this API does not run in a
  535. fully node-local fashion.
  536. *Impact* +
  537. Discontinue use of the `?local` query parameter. {ref}/cat-indices.html[cat indices
  538. API] requests that include this parameter will return an error.
  539. ====
  540. .The get field mapping API's `local` query parameter has been removed.
  541. [%collapsible]
  542. ====
  543. *Details* +
  544. The `local` parameter for get field mapping API was deprecated in 7.8 and is
  545. removed in 8.0. This parameter is a no-op and field mappings are always retrieved
  546. locally.
  547. *Impact* +
  548. Discontinue use of the `local` query parameter.
  549. {ref}/indices-get-field-mapping.html[get field mapping API] requests that
  550. include this parameter will return an error.
  551. ====
  552. .Post data to jobs API is deprecated.
  553. [%collapsible]
  554. ====
  555. *Details* +
  556. The {ml} {ref}/ml-post-data.html[post data to jobs API] is deprecated starting in 7.11.0
  557. and will be removed in a future major version.
  558. *Impact* +
  559. Use {ref}/ml-ad-apis.html#ml-api-datafeed-endpoint[{dfeeds}] instead.
  560. ====
  561. .The `job_id` property of the Update {dfeeds} API has been removed.
  562. [%collapsible]
  563. ====
  564. *Details* +
  565. The ability to update a `job_id` in a {dfeed} was deprecated in 7.3.0. and is
  566. removed in 8.0.
  567. *Impact* +
  568. It is not possible to move {dfeeds} between {anomaly-jobs}.
  569. ====
  570. .Create repository and delete repository API's return `409` status code when a repository is in use instead of `500`.
  571. [%collapsible]
  572. ====
  573. *Details* +
  574. The {ref}/put-snapshot-repo-api.html[Create or update snapshot repository API] and
  575. {ref}/delete-snapshot-repo-api.html[Delete snapshot repository API] return `409`
  576. status code when the request is attempting to modify an existing repository that's in use instead of status code `500`.
  577. *Impact* +
  578. Update client code that handles creation and deletion of repositories to reflect this change.
  579. ====
  580. .The `allow_no_datafeeds` property has been removed from {ml} APIs.
  581. [%collapsible]
  582. ====
  583. *Details* +
  584. The `allow_no_datafeeds` property was deprecated in the
  585. {ref}/cat-datafeeds.html[cat {dfeeds}],
  586. {ref}/ml-get-datafeed.html[get {dfeeds}],
  587. {ref}/ml-get-datafeed-stats.html[get {dfeed} statistics], and
  588. {ref}/ml-stop-datafeed.html[stop {dfeeds}] APIs in 7.10.0.
  589. *Impact* +
  590. Use `allow_no_match` instead.
  591. ====
  592. .The `allow_no_jobs` property has been removed from {ml} APIs.
  593. [%collapsible]
  594. ====
  595. *Details* +
  596. The `allow_no_jobs` property was deprecated in the
  597. {ref}/cat-anomaly-detectors.html[cat anomaly detectors],
  598. {ref}/ml-close-job.html[close {anomaly-jobs}],
  599. {ref}/ml-get-job.html[get {anomaly-jobs}],
  600. {ref}/ml-get-job-stats.html[get {anomaly-job} statistics], and
  601. {ref}/ml-get-overall-buckets.html[get overall buckets] APIs in 7.10.0.
  602. *Impact* +
  603. Use `allow_no_match` instead.
  604. ====
  605. .The StartRollupJob endpoint now returns a success status if a job has already started.
  606. [%collapsible]
  607. ====
  608. *Details* +
  609. Previously, attempting to start an already-started rollup job would
  610. result in a `500 InternalServerError: Cannot start task for Rollup Job
  611. [job] because state was [STARTED]` exception.
  612. Now, attempting to start a job that is already started will just
  613. return a successful `200 OK: started` response.
  614. *Impact* +
  615. Update your workflow and applications to assume that a 200 status in response to
  616. attempting to start a rollup job means the job is in an actively started state.
  617. The request itself may have started the job, or it was previously running and so
  618. the request had no effect.
  619. ====
  620. .Stored scripts no longer support empty scripts or search templates.
  621. [%collapsible]
  622. ====
  623. *Details* +
  624. The {ref}/create-stored-script-api.html[create or update stored script API]'s
  625. `source` parameter cannot be empty.
  626. *Impact* +
  627. Before upgrading, use the {ref}/delete-stored-script-api.html[delete stored
  628. script API] to delete any empty stored scripts or search templates.
  629. In 8.0, {es} will drop any empty stored scripts or empty search templates from
  630. the cluster state. Requests to create a stored script or search template with
  631. an empty `source` will return an error.
  632. ====
  633. .The create or update stored script API's `code` parameter has been removed.
  634. [%collapsible]
  635. ====
  636. *Details* +
  637. The {ref}/create-stored-script-api.html[create or update stored script API]'s
  638. `code` parameter has been removed. Use the `source` parameter instead.
  639. *Impact* +
  640. Discontinue use of the `code` parameter. Requests that include the parameter
  641. will return an error.
  642. ====
  643. [[_type-search-matches-no-docs]]
  644. .Searches on the `_type` field are no longer supported.
  645. [%collapsible]
  646. ====
  647. *Details* +
  648. In 8.x, the `_type` metadata field has been removed. {es} now handles a search
  649. on the `_type` field as a search on a non-existent field. A search on a
  650. non-existent field matches no documents, regardless of the query string.
  651. In 7.x, a search for `_doc` in the `_type` field would match the same documents
  652. as a `match_all` query.
  653. *Impact* +
  654. Remove queries on the `_type` field from your search requests and search
  655. templates. Searches that include these queries may return no results.
  656. ====
  657. [[msearch-empty-line-support]]
  658. .The multi search API now parses an empty first line as action metadata in text files.
  659. [%collapsible]
  660. ====
  661. *Details* +
  662. The multi search API now parses an empty first line as empty action metadata
  663. when you provide a text file as the request body, such as when using curl's
  664. `--data-binary` flag.
  665. The API no longer supports text files that contain:
  666. * An empty first line followed by a line containing only `{}`.
  667. * An empty first line followed by another empty line.
  668. *Impact* +
  669. Don't provide an unsupported text file to the multi search API. Requests that
  670. include an unsupported file will return an error.
  671. ====
  672. [[remove-unmapped-type-string]]
  673. .The `unmapped_type: string` sort option has been removed.
  674. [%collapsible]
  675. ====
  676. *Details* +
  677. Search requests no longer support the `unmapped_type: string` sort option.
  678. Instead, use `unmapped_type: keyword` to handle an unmapped field as if it had
  679. the `keyword` field type but ignore its values for sorting.
  680. *Impact* +
  681. Discontinue use of `unmapped_type: string`. Search requests that include the
  682. `unmapped_type: string` sort option will return shard failures.
  683. ====
  684. [[id-field-data]]
  685. .Aggregating and sorting on `_id` is disallowed by default.
  686. [%collapsible]
  687. ====
  688. *Details* +
  689. Previously, it was possible to aggregate and sort on the built-in `_id` field
  690. by loading an expensive data structure called fielddata. This was deprecated
  691. in 7.6 and is now disallowed by default in 8.0.
  692. *Impact* +
  693. Aggregating and sorting on `_id` should be avoided. As an alternative, the
  694. `_id` field's contents can be duplicated into another field with docvalues
  695. enabled (note that this does not apply to auto-generated IDs).
  696. ====
  697. .The `common` query has been removed.
  698. [%collapsible]
  699. ====
  700. *Details* +
  701. The `common` query, deprecated in 7.x, has been removed in 8.0.
  702. The same functionality can be achieved by the `match` query if the total number of hits is not tracked.
  703. *Impact* +
  704. Discontinue use of the `common` query. Search requests containing a `common`
  705. query will return an error.
  706. ====
  707. .The `cutoff_frequency` parameter has been removed from the `match` and `multi_match` query.
  708. [%collapsible]
  709. ====
  710. *Details* +
  711. The `cutoff_frequency` parameter, deprecated in 7.x, has been removed in 8.0 from `match` and `multi_match` queries.
  712. The same functionality can be achieved without any configuration provided that the total number of hits is not tracked.
  713. *Impact* +
  714. Discontinue use of the `cutoff_frequency` parameter. Search requests containing
  715. this parameter in a `match` or `multi_match` query will return an error.
  716. ====
  717. .The `nested_filter` and `nested_path` properties have been removed from the search API's `sort` request body parameter.
  718. [%collapsible]
  719. ====
  720. *Details* +
  721. The `nested_filter` and `nested_path` options, deprecated in 6.x, have been removed in favor of the `nested` context.
  722. *Impact* +
  723. Discontinue use of the `sort` request body parameter's `nested_filter` and
  724. `nested_path` properties. Requests containing these properties will return an
  725. error.
  726. ====
  727. .Search and get requests are now routed to shards using adaptive replica selection by default.
  728. [%collapsible]
  729. ====
  730. *Details* +
  731. {es} will no longer prefer using shards in the same location (with the same awareness attribute values) to process
  732. `_search` and `_get` requests. Adaptive replica selection (activated by default in this version) will route requests
  733. more efficiently using the service time of prior inter-node communications.
  734. *Impact* +
  735. No action needed.
  736. ====
  737. .Vector functions using `(query, doc['field'])` are no longer supported.
  738. [%collapsible]
  739. ====
  740. *Details* +
  741. The vector functions of the form `function(query, doc['field'])` were
  742. deprecated in 7.6, and are now removed in 8.x. The form
  743. `function(query, 'field')` should be used instead. For example,
  744. `cosineSimilarity(query, doc['field'])` is replaced by
  745. `cosineSimilarity(query, 'field')`.
  746. *Impact* +
  747. Use the `function(query, 'field')` form. Discontinue use of the `function(query,
  748. doc['field'])` form. Requests containing the `function(query,
  749. doc['field'])` form will return an error.
  750. ====
  751. .The search API's `indices_boost` request body parameter no longer accepts object values.
  752. [%collapsible]
  753. ====
  754. *Details* +
  755. The `indices_boost` option in the search request used to accept the boosts
  756. both as an object and as an array. The object format has been deprecated since
  757. 5.2 and is now removed in 8.0.
  758. *Impact* +
  759. Use only array values in the `indices_boost` parameter. Requests containing an
  760. object value in the `indices_boost` parameter will return an error.
  761. ====
  762. .The search API's `use_field_mapping` request body parameter has been removed.
  763. [%collapsible]
  764. ====
  765. *Details* +
  766. In 7.0, we began formatting `docvalue_fields` by default using each field's
  767. mapping definition. To ease the transition from 6.x, we added the format
  768. option `use_field_mapping`. This parameter was deprecated in 7.0, and is now
  769. removed in 8.0.
  770. *Impact* +
  771. Discontinue use of the `use_field_mapping` request body parameter. Requests
  772. containing this parameter will return an error.
  773. *Compatibility* +
  774. When {ref}/rest-api-compatibility.html[rest-api-compatibility] is
  775. {ref}/rest-api-compatibility.html[requested], the `use_field_mapping` parameter
  776. is ignored.
  777. ====
  778. .The search API's `from` request body and url parameter cannot be negative.
  779. [%collapsible]
  780. ====
  781. *Details* +
  782. Search request used to accept `-1` as a `from` in the search body and the url,
  783. treating it as the default value of 0. Other negative values got rejected with
  784. an error already. We now also reject `-1` as an invalid value.
  785. *Impact* +
  786. Change any use of `-1` as `from` parameter in request body or url parameters by either
  787. setting it to `0` or omitting it entirely. Requests containing negative values will
  788. return an error.
  789. ====
  790. .Range queries on date fields treat numeric values alwas as milliseconds-since-epoch.
  791. [%collapsible]
  792. ====
  793. *Details* +
  794. Range queries on date fields used to misinterpret small numbers (e.g. four digits like 1000)
  795. as a year when no additional format was set, but would interpret other numeric values as
  796. milliseconds since epoch. We now treat all numeric values in absence of a specific `format`
  797. parameter as milliseconds since epoch. If you want to query for years instead, with a missing
  798. `format` you now need to quote the input value (e.g. "1984").
  799. *Impact* +
  800. If you query date fields without a specified `format`, check if the values in your queries are
  801. actually meant to be milliseconds-since-epoch and use a numeric value in this case. If not, use
  802. a string value which gets parsed by either the date format set on the field in the mappings or
  803. by `strict_date_optional_time` by default.
  804. ====
  805. .The `geo_bounding_box` query's `type` parameter has been removed.
  806. [%collapsible]
  807. ====
  808. *Details* +
  809. The `geo_bounding_box` query's `type` parameter was deprecated in 7.14.0 and has
  810. been removed in 8.0.0. This parameter is a no-op and has no effect on the query.
  811. *Impact* +
  812. Discontinue use of the `type` parameter. `geo_bounding_box` queries that include
  813. this parameter will return an error.
  814. ====
  815. .The `type` query has been removed.
  816. [%collapsible]
  817. ====
  818. *Details* +
  819. The `type` query has been removed. Mapping types have been removed in 8.0.
  820. *Impact* +
  821. Discontinue use of the `type` query. Requests that include the `type` query
  822. will return an error.
  823. ====
  824. .The `kibana_user` role has been renamed `kibana_admin`.
  825. [%collapsible]
  826. ====
  827. *Details* +
  828. Users who were previously assigned the `kibana_user` role should instead be assigned
  829. the `kibana_admin` role. This role grants the same set of privileges as `kibana_user`, but has been
  830. renamed to better reflect its intended use.
  831. *Impact* +
  832. Assign users with the `kibana_user` role to the `kibana_admin` role.
  833. Discontinue use of the `kibana_user` role.
  834. ====
  835. [[snapshot-resolve-system-indices]]
  836. .For snapshot and {slm-init} APIs, the `indices` parameter no longer resolves to system indices or system data streams.
  837. [%collapsible]
  838. ====
  839. *Details* +
  840. For snapshot and {slm-init} APIs, the `indices` parameter no longer resolves to
  841. system indices or system data streams.
  842. {ref}/snapshot-restore.html#feature-state[Feature states] are now the only way
  843. to back up and restore system indices or system data streams from a snapshot.
  844. You can no longer use the `indices` parameter for the
  845. {ref}/slm-api-put-policy.html[create {slm-init} policy API] or the
  846. {ref}/create-snapshot-api.html[create snapshot API] to include a system index in
  847. a snapshot. To back up a system index, use the `include_global_state` and
  848. `feature_states` parameters to include the corresponding feature state instead.
  849. By default, the `include_global_state` and `feature_states` parameters include
  850. all system indices.
  851. Similarly, you can no longer use the {ref}/restore-snapshot-api.html[restore snapshot
  852. API]'s `indices` parameter to restore a system index from a snapshot. To restore
  853. a system index, use the `include_global_state` and `feature_states` parameters
  854. to restore the corresponding feature state instead. By default, the
  855. `include_global_state` and `feature_states` parameters don't restore any system
  856. indices.
  857. *Impact* +
  858. If you previously used the `indices` parameter to back up or restore system
  859. indices, update your {slm-init} policies and application to use the
  860. `include_global_state` and `feature_states` parameters instead.
  861. An {slm-init} policy that explicitly specifies a system index in the `indices`
  862. parameter will fail to create snapshots. Similarly, a create snapshot API or
  863. restore snapshot API request that explicitly specifies a system index in the
  864. `indices` parameter will fail and return an error. If the `indices` value
  865. includes a wildcard (`*`) pattern, the pattern will no longer match system
  866. indices.
  867. ====
  868. .Snapshots compress metadata files by default.
  869. [%collapsible]
  870. ====
  871. *Details* +
  872. Previously, the default value for `compress` was `false`. The default has been changed to `true`.
  873. This change will affect both newly created repositories and existing repositories where `compress=false` has not been
  874. explicitly specified.
  875. *Impact* +
  876. Update your workflow and applications to assume a default value of `true` for
  877. the `compress` parameter.
  878. ====
  879. .S3 snapshot repositories now use a DNS-style access pattern by default.
  880. [%collapsible]
  881. ====
  882. *Details* +
  883. Starting in version 7.4, `s3` snapshot repositories no longer use the
  884. now-deprecated path-style access pattern by default. In versions 7.0, 7.1, 7.2
  885. and 7.3 `s3` snapshot repositories always used the path-style access pattern.
  886. This is a breaking change for deployments that only support path-style access
  887. but which are recognized as supporting DNS-style access by the AWS SDK. This
  888. breaking change was made necessary by
  889. https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/[AWS's
  890. announcement] that the path-style access pattern is deprecated and will be
  891. unsupported on buckets created after September 30th 2020.
  892. *Impact* +
  893. If your deployment only supports path-style access and is affected by this
  894. change then you must configure the S3 client setting `path_style_access` to
  895. `true`.
  896. ====
  897. .Restore requests no longer accept settings.
  898. [%collapsible]
  899. ====
  900. *Details* +
  901. In earlier versions, you could pass both `settings` and `index_settings` in the
  902. body of a restore snapshot request, but the `settings` value was ignored. The
  903. restore snapshot API now rejects requests that include a `settings` value.
  904. *Impact* +
  905. Discontinue use of the `settings` parameter in restore
  906. snapshot request. Requests that include these parameters will return an error.
  907. ====
  908. .The repository stats API has been removed.
  909. [%collapsible]
  910. ====
  911. *Details* +
  912. The repository stats API has been removed. We deprecated this experimental API
  913. in 7.10.0.
  914. *Impact* +
  915. Use the {ref}/repositories-metering-apis.html[repositories metering APIs]
  916. instead.
  917. ====
  918. .Watcher history now writes to a hidden data stream.
  919. [%collapsible]
  920. ====
  921. *Details* +
  922. In 8.x, {es} writes Watcher history to a hidden
  923. `.watcher-history-<index-template-version>` data stream. Previously, {es} wrote
  924. Watcher history to hidden
  925. `.watcher-history-<index-template-version>-<yyyy-MM-dd>` indices.
  926. *Impact* +
  927. Update your requests to target the Watcher history data stream. For example, use
  928. the `.watcher-history-*` wildcard expression. Requests that specifically target
  929. non-existent Watcher history indices may return an error.
  930. ====
  931. .HTTP Status code has changed for the Cluster Health API in case of a server timeout.
  932. [%collapsible]
  933. ====
  934. *Details* +
  935. The {ref}/cluster-health.html[cluster health API] includes options for waiting
  936. for certain health conditions to be satisfied. If the requested conditions are
  937. not satisfied within a timeout then {es} will send back a normal response
  938. including the field `"timed_out": true`. In earlier versions it would also use
  939. the HTTP response code `408 Request timeout` if the request timed out, and `200
  940. OK` otherwise. The `408 Request timeout` response code is not appropriate for
  941. this situation, so from version 8.0.0 {es} will use the response code `200 OK`
  942. for both cases.
  943. *Impact* +
  944. To detect a server timeout, check the `timed_out` field of the JSON response.
  945. ====
  946. //end::notable-breaking-changes[]