Java API client version
9.3
Java version
25
Elasticsearch Version
9.3
Problem description
In 9.3 you changed the routing code to use a List<String> instead of String
|
private final List<String> routing; |
Previously setting routing to null meant nothing as it was detected and not used. But in 9.3, setting routing to null creates a List of a single null element
|
public final Builder<TDocument> routing(String value, String... values) { |
|
this.routing = _listAdd(this.routing, value, values); |
|
return this; |
Then on a build call this section is executed
|
if (ApiTypeHelper.isDefined(request.routing)) { |
|
params.put("routing", request.routing.stream().map(v -> v).collect(Collectors.joining(","))); |
|
} |
which results in the following being appended to url
?routing=null
And elasticsearch then ends up looking for or adding the document in potential the wrong place (depending on how many shades are being used for that index).
Java API client version
9.3
Java version
25
Elasticsearch Version
9.3
Problem description
In 9.3 you changed the routing code to use a
List<String>instead ofStringelasticsearch-java/java-client/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java
Line 304 in b4b8c3e
Previously setting routing to
nullmeant nothing as it was detected and not used. But in 9.3, setting routing tonullcreates a List of a single null elementelasticsearch-java/java-client/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java
Lines 771 to 773 in de9b5d4
Then on a build call this section is executed
elasticsearch-java/java-client/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java
Lines 1033 to 1035 in b4b8c3e
which results in the following being appended to url
?routing=nullAnd elasticsearch then ends up looking for or adding the document in potential the wrong place (depending on how many shades are being used for that index).