From 4625270ce093411a85c824e1aea5742a6ae1426e Mon Sep 17 00:00:00 2001 From: jimczi Date: Thu, 21 Feb 2019 16:36:26 +0900 Subject: [PATCH] LUCENE-8686: Fix test bug in TestTaxonomyFacetSumValueSource#testRandom --- .../facet/taxonomy/TestTaxonomyFacetSumValueSource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java index 76493ed1b61..b686d92290d 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetSumValueSource.java @@ -452,8 +452,10 @@ public class TestTaxonomyFacetSumValueSource extends FacetTestCase { List labelValues = new ArrayList<>(); double totValue = 0; for(Map.Entry ent : expectedValues[i].entrySet()) { - labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue())); - totValue += ent.getValue(); + if (ent.getValue() > 0) { + labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue())); + totValue += ent.getValue(); + } } sortLabelValues(labelValues); if (totValue > 0) {