@@ -1246,11 +1246,9 @@ public MsearchRequest searchMsearchRequest(
1246
1246
}
1247
1247
1248
1248
if (!isEmpty (query .getIndicesBoost ())) {
1249
- Map <String , Double > boosts = new LinkedHashMap <>();
1250
- query .getIndicesBoost ()
1251
- .forEach (indexBoost -> boosts .put (indexBoost .getIndexName (), (double ) indexBoost .getBoost ()));
1252
- // noinspection unchecked
1253
- bb .indicesBoost (boosts );
1249
+ bb .indicesBoost (query .getIndicesBoost ().stream ()
1250
+ .map (indexBoost -> Map .of (indexBoost .getIndexName (), Double .valueOf (indexBoost .getBoost ())))
1251
+ .collect (Collectors .toList ()));
1254
1252
}
1255
1253
1256
1254
query .getScriptedFields ().forEach (scriptedField -> bb .scriptFields (scriptedField .getFieldName (),
@@ -1412,11 +1410,9 @@ private <T> void prepareSearchRequest(Query query, @Nullable String routing, @Nu
1412
1410
}
1413
1411
1414
1412
if (!isEmpty (query .getIndicesBoost ())) {
1415
- Map <String , Double > boosts = new LinkedHashMap <>();
1416
- query .getIndicesBoost ()
1417
- .forEach (indexBoost -> boosts .put (indexBoost .getIndexName (), (double ) indexBoost .getBoost ()));
1418
- // noinspection unchecked
1419
- builder .indicesBoost (boosts );
1413
+ builder .indicesBoost (query .getIndicesBoost ().stream ()
1414
+ .map (indexBoost -> Map .of (indexBoost .getIndexName (), Double .valueOf (indexBoost .getBoost ())))
1415
+ .collect (Collectors .toList ()));
1420
1416
}
1421
1417
1422
1418
if (!isEmpty (query .getDocValueFields ())) {
0 commit comments