SOLR-5230: Call DelegatingCollector.finish() during grouping

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1562305 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2014-01-28 23:07:25 +00:00
parent d593f195ba
commit 7a648bf7db
3 changed files with 20 additions and 0 deletions

View File

@ -234,6 +234,10 @@ Bug Fixes
* SOLR-5666: Using the hdfs write cache can result in appearance of corrupted
index. (Mark Miller)
* SOLR-5230: Call DelegatingCollector.finish() during grouping.
(Joel Bernstein, ehatcher)
Optimizations
----------------------

View File

@ -346,6 +346,10 @@ public class Grouping {
if (allCollectors != null) {
searchWithTimeLimiter(luceneFilter, allCollectors);
if(allCollectors instanceof DelegatingCollector) {
((DelegatingCollector) allCollectors).finish();
}
}
if (getGroupedDocSet && allGroupHeadsCollector != null) {
@ -382,6 +386,10 @@ public class Grouping {
secondPhaseCollectors = pf.postFilter;
}
searchWithTimeLimiter(luceneFilter, secondPhaseCollectors);
if(secondPhaseCollectors instanceof DelegatingCollector) {
((DelegatingCollector) secondPhaseCollectors).finish();
}
}
}
}

View File

@ -286,5 +286,13 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("facet.mincount", "1");
assertQ(req(params), "*[count(//doc)=1]", "*[count(//lst[@name='facet_fields']/lst[@name='test_ti']/int)=2]");
// SOLR-5230 - ensure CollapsingFieldValueCollector.finish() is called
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_s}");
params.add("group", "true");
params.add("group.field", "id");
assertQ(req(params), "*[count(//doc)=2]");
}
}