mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 06:25:07 +00:00
Tests - fix incorrect test assumption that zero-doc buckets will be returned by the adjacency matrix aggregation. Closes #29159 (#29167)
This commit is contained in:
parent
2f6c77337e
commit
93ff973afc
@ -82,8 +82,10 @@ public class InternalAdjacencyMatrixTests extends InternalMultiBucketAggregation
|
|||||||
final Map<String, Long> expectedCounts = new TreeMap<>();
|
final Map<String, Long> expectedCounts = new TreeMap<>();
|
||||||
for (InternalAdjacencyMatrix input : inputs) {
|
for (InternalAdjacencyMatrix input : inputs) {
|
||||||
for (InternalAdjacencyMatrix.InternalBucket bucket : input.getBuckets()) {
|
for (InternalAdjacencyMatrix.InternalBucket bucket : input.getBuckets()) {
|
||||||
expectedCounts.compute(bucket.getKeyAsString(),
|
if (bucket.getDocCount() > 0) {
|
||||||
|
expectedCounts.compute(bucket.getKeyAsString(),
|
||||||
(key, oldValue) -> (oldValue == null ? 0 : oldValue) + bucket.getDocCount());
|
(key, oldValue) -> (oldValue == null ? 0 : oldValue) + bucket.getDocCount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Map<String, Long> actualCounts = new TreeMap<>();
|
final Map<String, Long> actualCounts = new TreeMap<>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user