aggregations.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [[breaking_60_aggregations_changes]]
  2. === Aggregations changes
  3. ==== Deprecated `pattern` element of include/exclude for terms aggregations has been removed
  4. The `include` and `exclude` options of `terms` aggregations used to accept a
  5. sub `pattern` object which has been removed. The pattern should now be directly
  6. put as a value of the `include` and `exclude` fields. For instance, the below
  7. `terms` aggregation:
  8. [source,js]
  9. --------------------------------------------------
  10. POST /twitter/_search?size=0
  11. {
  12. "aggs" : {
  13. "top_users" : {
  14. "terms" : {
  15. "field" : "user",
  16. "include": {
  17. "pattern": "foo.*"
  18. },
  19. "exclude": {
  20. "pattern": ".*bar"
  21. }
  22. }
  23. }
  24. }
  25. }
  26. --------------------------------------------------
  27. // CONSOLE
  28. // TEST[skip: uses old unsupported syntax]
  29. should be replaced with:
  30. [source,js]
  31. --------------------------------------------------
  32. POST /twitter/_search?size=0
  33. {
  34. "aggs" : {
  35. "top_users" : {
  36. "terms" : {
  37. "field" : "user",
  38. "include": "foo.*",
  39. "exclude": ".*bar"
  40. }
  41. }
  42. }
  43. }
  44. --------------------------------------------------
  45. // CONSOLE
  46. // TEST[setup:twitter]
  47. ==== Numeric `to` and `from` parameters in `date_range` aggregation are interpreted according to `format` now
  48. Numeric `to` and `from` parameters in `date_range` aggregations used to always be interpreted as `epoch_millis`,
  49. making other numeric formats like `epoch_seconds` unusable for numeric input values.
  50. Now we interpret these parameters according to the `format` of the target field.
  51. If the `format` in the mappings is not compatible with the numeric input value, a compatible
  52. `format` (e.g. `epoch_millis`, `epoch_second`) must be specified in the `date_range` aggregation, otherwise an error is thrown.