2017-02-17 14:45:41 -05:00
|
|
|
[[breaking_60_java_changes]]
|
|
|
|
=== Java API changes
|
|
|
|
|
|
|
|
==== `setSource` methods require XContentType
|
|
|
|
|
|
|
|
Previously the `setSource` methods and other methods that accepted byte/string representations of
|
|
|
|
an object source did not require the XContentType to be specified. The auto-detection of the content
|
|
|
|
type is no longer used, so these methods now require the XContentType as an additional argument when
|
|
|
|
providing the source in bytes or as a string.
|
2017-03-28 10:44:57 -04:00
|
|
|
|
2017-05-03 05:20:53 -04:00
|
|
|
==== `DeleteByQueryRequest` requires an explicitly set query
|
2017-03-28 10:44:57 -04:00
|
|
|
|
|
|
|
In previous versions of Elasticsearch, delete by query requests without an explicit query
|
|
|
|
were accepted, match_all was used as the default query and all documents were deleted
|
|
|
|
as a result. From version 6.0.0, a `DeleteByQueryRequest` requires an explicit query be set.
|
2017-04-24 12:40:57 -04:00
|
|
|
|
2017-05-03 05:20:53 -04:00
|
|
|
==== `InternalStats` and `Stats` getCountAsString() method removed
|
2017-04-24 12:40:57 -04:00
|
|
|
|
|
|
|
The `count` value in the stats aggregation represents a doc count that shouldnn't require a formatted
|
|
|
|
version. This method was deprecated in 5.4 in favour of just using
|
|
|
|
`String.valueOf(getCount())` if needed
|
2017-05-03 05:20:53 -04:00
|
|
|
|
|
|
|
==== `ActionRequestBuilder#execute` returns `ActionFuture` rather than `ListenableActionFuture`
|
|
|
|
|
|
|
|
When sending a request through the request builders e.g. client.prepareSearch().execute(), it used to
|
|
|
|
be possible to call `addListener` against the returned `ListenableActionFuture`. With this change an
|
|
|
|
`ActionFuture` is returned instead, which is consistent with what the `Client` methods return, hence
|
|
|
|
it is not possible to associate the future with listeners. The `execute` method that accept a listener
|
|
|
|
as an argument can be used instead.
|