migrate_3_0.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [[breaking-changes-3.0]]
  2. == Breaking changes in 3.0
  3. This section discusses the changes that you need to be aware of when migrating
  4. your application to Elasticsearch 3.0.
  5. === Search changes
  6. ==== `search_type=count` removed
  7. The `count` search type was deprecated since version 2.0.0 and is now removed.
  8. In order to get the same benefits, you just need to set the value of the `size`
  9. parameter to `0`.
  10. For instance, the following request:
  11. [source,sh]
  12. ---------------
  13. GET /my_index/_search?search_type=count
  14. {
  15. "aggs": {
  16. "my_terms": {
  17. "terms": {
  18. "field": "foo"
  19. }
  20. }
  21. }
  22. }
  23. ---------------
  24. can be replaced with:
  25. [source,sh]
  26. ---------------
  27. GET /my_index/_search
  28. {
  29. "size": 0,
  30. "aggs": {
  31. "my_terms": {
  32. "terms": {
  33. "field": "foo"
  34. }
  35. }
  36. }
  37. }
  38. ---------------
  39. ==== `search_type=scan` removed
  40. The `scan` search type was deprecated since version 2.1.0 and is now removed.
  41. All benefits from this search type can now be achieved by doing a scroll
  42. request that sorts documents in `_doc` order, for instance:
  43. [source,sh]
  44. ---------------
  45. GET /my_index/_search?scroll=2m
  46. {
  47. "sort": [
  48. "_doc"
  49. ]
  50. }
  51. ---------------
  52. Scroll requests sorted by `_doc` have been optimized to more efficiently resume
  53. from where the previous request stopped, so this will have the same performance
  54. characteristics as the former `scan` search type.
  55. === Parent/Child changes
  56. The `children` aggregation, parent child inner hits and `has_child` and `has_parent` queries will not work on indices
  57. with `_parent` field mapping created before version `2.0.0`. The data of these indices need to be re-indexed into a new index.
  58. The format of the join between parent and child documents have changed with the `2.0.0` release. The old
  59. format can't read from version `3.0.0` and onwards. The new format allows for a much more efficient and
  60. scalable join between parent and child documents and the join data structures are stored on on disk
  61. data structures as opposed as before the join data structures were stored in the jvm heap space.
  62. ==== `score_type` has been removed
  63. The `score_type` option has been removed from the `has_child` and `has_parent` queries in favour of the `score_mode` option
  64. which does the exact same thing.
  65. ==== `sum` score mode removed
  66. The `sum` score mode has been removed in favour of the `total` mode which doesn the same and is already available in
  67. previous versions.
  68. ==== `max_children` option
  69. When `max_children` was set to `0` on the `has_child` query then there was no upper limit on how many children documents
  70. are allowed to match. This has changed and `0` now really means to zero child documents are allowed. If no upper limit
  71. is needed then the `max_children` option shouldn't be defined at all on the `has_child` query.