@@ -820,7 +820,7 @@ public co.elastic.clients.elasticsearch.core.ReindexRequest reindex(ReindexReque
820
820
.refresh (reindexRequest .getRefresh ()) //
821
821
.requireAlias (reindexRequest .getRequireAlias ()) //
822
822
.requestsPerSecond (reindexRequest .getRequestsPerSecond ()) //
823
- .slices (reindexRequest .getSlices ());
823
+ .slices (slices ( reindexRequest .getSlices () ));
824
824
825
825
return builder .build ();
826
826
}
@@ -963,24 +963,24 @@ public UpdateByQueryRequest documentUpdateByQueryRequest(UpdateQuery updateQuery
963
963
.pipeline (updateQuery .getPipeline ()) //
964
964
.requestsPerSecond (
965
965
updateQuery .getRequestsPerSecond () != null ? updateQuery .getRequestsPerSecond ().longValue () : null ) //
966
- .slices (updateQuery .getSlices () != null ? Long .valueOf (updateQuery .getSlices ()) : null ) //
967
- ;
966
+ .slices (slices (updateQuery .getSlices () != null ? Long .valueOf (updateQuery .getSlices ()) : null ));
968
967
969
968
if (updateQuery .getAbortOnVersionConflict () != null ) {
970
969
ub .conflicts (updateQuery .getAbortOnVersionConflict () ? Conflicts .Abort : Conflicts .Proceed );
971
970
}
972
971
973
- if (updateQuery .getBatchSize () != null ) {
974
- ub .size (Long .valueOf (updateQuery .getBatchSize ()));
975
- }
976
-
977
972
if (updateQuery .getQuery () != null ) {
978
973
Query queryQuery = updateQuery .getQuery ();
974
+
975
+ if (updateQuery .getBatchSize () != null ) {
976
+ ((BaseQuery ) queryQuery ).setMaxResults (updateQuery .getBatchSize ());
977
+ }
979
978
ub .query (getQuery (queryQuery , null ));
980
979
981
980
// no indicesOptions available like in old client
982
981
983
982
ub .scroll (time (queryQuery .getScrollTime ()));
983
+
984
984
}
985
985
986
986
// no maxRetries available like in old client
@@ -1164,11 +1164,11 @@ private <T> void prepareSearchRequest(Query query, @Nullable Class<T> clazz, Ind
1164
1164
1165
1165
if (!query .getRuntimeFields ().isEmpty ()) {
1166
1166
1167
- Map <String , RuntimeField > runtimeMappings = new HashMap <>();
1167
+ Map <String , List < RuntimeField > > runtimeMappings = new HashMap <>();
1168
1168
query .getRuntimeFields ().forEach (runtimeField -> {
1169
- runtimeMappings .put (runtimeField .getName (), RuntimeField .of (rt -> rt //
1169
+ runtimeMappings .put (runtimeField .getName (), Collections . singletonList ( RuntimeField .of (rt -> rt //
1170
1170
.type (RuntimeFieldType ._DESERIALIZER .parse (runtimeField .getType ())) //
1171
- .script (s -> s .inline (is -> is .source (runtimeField .getScript ())))));
1171
+ .script (s -> s .inline (is -> is .source (runtimeField .getScript ())))))) ;
1172
1172
});
1173
1173
builder .runtimeMappings (runtimeMappings );
1174
1174
}
@@ -1328,6 +1328,7 @@ private co.elastic.clients.elasticsearch._types.query_dsl.Query getQuery(@Nullab
1328
1328
} else {
1329
1329
throw new IllegalArgumentException ("unhandled Query implementation " + query .getClass ().getName ());
1330
1330
}
1331
+
1331
1332
return esQuery ;
1332
1333
}
1333
1334
0 commit comments