SOLR-7616: fix UniqueAgg.NumericAcc.resize

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1683357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2015-06-03 15:03:29 +00:00
parent 0311e20f81
commit 994ae6590c
3 changed files with 7 additions and 1 deletions

View File

@ -94,6 +94,10 @@ Bug Fixes
* SOLR-7361: Slow loading SolrCores should not hold up all other SolrCores that have finished loading from serving
requests. (Mark Miller, Timothy Potter, Ramkumar Aiyengar)
* SOLR-7616: Faceting on a numeric field with a unique() subfacet function on another numeric field
can result in incorrect results or an exception. (yonik)
Optimizations
----------------------
(no changes)

View File

@ -208,7 +208,7 @@ public class UniqueAgg extends StrAggValueSource {
@Override
public void resize(Resizer resizer) {
resizer.resize(sets, null);
sets = resizer.resize(sets, null);
}
@Override

View File

@ -932,6 +932,7 @@ public class TestJsonFacets extends SolrTestCaseHS {
",f8:{ type:field, field:${num_i}, sort:'index desc', offset:100, numBuckets:true }" + // test high offset
",f9:{ type:field, field:${num_i}, sort:'x desc', facet:{x:'avg(${num_d})'}, missing:true, allBuckets:true, numBuckets:true }" + // test stats
",f10:{ type:field, field:${num_i}, facet:{a:{query:'${cat_s}:A'}}, missing:true, allBuckets:true, numBuckets:true }" + // test subfacets
",f11:{ type:field, field:${num_i}, facet:{a:'unique(${num_d})'} ,missing:true, allBuckets:true, sort:'a desc' }" + // test subfacet using unique on numeric field (this previously triggered a resizing bug)
"}"
)
, "facets=={count:6 " +
@ -945,6 +946,7 @@ public class TestJsonFacets extends SolrTestCaseHS {
",f8:{ buckets:[] , numBuckets:4 } " +
",f9:{ buckets:[{val:7,count:1,x:11.0},{val:2,count:1,x:4.0},{val:3,count:1,x:2.0},{val:-5,count:2,x:-7.0} ], numBuckets:4, allBuckets:{count:5,x:0.6},missing:{count:1,x:0.0} } " + // TODO: should missing exclude "x" because no values were collected?
",f10:{ buckets:[{val:-5,count:2,a:{count:0}},{val:2,count:1,a:{count:1}},{val:3,count:1,a:{count:1}},{val:7,count:1,a:{count:0}} ], numBuckets:4, allBuckets:{count:5},missing:{count:1,a:{count:0}} } " +
",f11:{ buckets:[{val:-5,count:2,a:2},{val:2,count:1,a:1},{val:3,count:1,a:1},{val:7,count:1,a:1} ] , missing:{count:1,a:0} , allBuckets:{count:5,a:5} } " +
"}"
);