mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-05 18:22:23 +00:00
Fix IndicesBoost error.
Original Pull Request #2606 Closes #2598 (cherry picked from commit d9fd722bb6af81068fb9b723b77c60efddbf06d3)
This commit is contained in:
parent
c218c1d5e3
commit
31365fb722
@ -1146,11 +1146,9 @@ class RequestConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isEmpty(query.getIndicesBoost())) {
|
if (!isEmpty(query.getIndicesBoost())) {
|
||||||
Map<String, Double> boosts = new LinkedHashMap<>();
|
bb.indicesBoost(query.getIndicesBoost().stream()
|
||||||
query.getIndicesBoost()
|
.map(indexBoost -> Map.of(indexBoost.getIndexName(), Double.valueOf(indexBoost.getBoost())))
|
||||||
.forEach(indexBoost -> boosts.put(indexBoost.getIndexName(), (double) indexBoost.getBoost()));
|
.collect(Collectors.toList()));
|
||||||
// noinspection unchecked
|
|
||||||
bb.indicesBoost(boosts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query instanceof NativeQuery) {
|
if (query instanceof NativeQuery) {
|
||||||
@ -1301,11 +1299,9 @@ class RequestConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isEmpty(query.getIndicesBoost())) {
|
if (!isEmpty(query.getIndicesBoost())) {
|
||||||
Map<String, Double> boosts = new LinkedHashMap<>();
|
builder.indicesBoost(query.getIndicesBoost().stream()
|
||||||
query.getIndicesBoost()
|
.map(indexBoost -> Map.of(indexBoost.getIndexName(), Double.valueOf(indexBoost.getBoost())))
|
||||||
.forEach(indexBoost -> boosts.put(indexBoost.getIndexName(), (double) indexBoost.getBoost()));
|
.collect(Collectors.toList()));
|
||||||
// noinspection unchecked
|
|
||||||
builder.indicesBoost(boosts);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user