@@ -1250,11 +1250,9 @@ public MsearchRequest searchMsearchRequest(
1250
1250
}
1251
1251
1252
1252
if (!isEmpty (query .getIndicesBoost ())) {
1253
- Map <String , Double > boosts = new LinkedHashMap <>();
1254
- query .getIndicesBoost ()
1255
- .forEach (indexBoost -> boosts .put (indexBoost .getIndexName (), (double ) indexBoost .getBoost ()));
1256
- // noinspection unchecked
1257
- bb .indicesBoost (boosts );
1253
+ bb .indicesBoost (query .getIndicesBoost ().stream ()
1254
+ .map (indexBoost -> Map .of (indexBoost .getIndexName (), Double .valueOf (indexBoost .getBoost ())))
1255
+ .collect (Collectors .toList ()));
1258
1256
}
1259
1257
1260
1258
query .getScriptedFields ().forEach (scriptedField -> bb .scriptFields (scriptedField .getFieldName (),
@@ -1419,11 +1417,9 @@ private <T> void prepareSearchRequest(Query query, @Nullable String routing, @Nu
1419
1417
}
1420
1418
1421
1419
if (!isEmpty (query .getIndicesBoost ())) {
1422
- Map <String , Double > boosts = new LinkedHashMap <>();
1423
- query .getIndicesBoost ()
1424
- .forEach (indexBoost -> boosts .put (indexBoost .getIndexName (), (double ) indexBoost .getBoost ()));
1425
- // noinspection unchecked
1426
- builder .indicesBoost (boosts );
1420
+ builder .indicesBoost (query .getIndicesBoost ().stream ()
1421
+ .map (indexBoost -> Map .of (indexBoost .getIndexName (), Double .valueOf (indexBoost .getBoost ())))
1422
+ .collect (Collectors .toList ()));
1427
1423
}
1428
1424
1429
1425
if (!isEmpty (query .getDocValueFields ())) {
0 commit comments