percolator: if size is 0 then use TotalHitCountCollector

Fixes PercolateIT#testPercolateSizingWithQueryAndFilter test
This commit is contained in:
Martijn van Groningen 2016-01-06 18:00:00 +01:00
parent 2d6adf6428
commit 247ce06fc3
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ public class PercolatorService extends AbstractComponent {
}
PercolatorQuery percolatorQuery = builder.build();
if (context.isOnlyCount()) {
if (context.isOnlyCount() || context.size() == 0) {
TotalHitCountCollector collector = new TotalHitCountCollector();
context.searcher().search(percolatorQuery, MultiCollector.wrap(collector, aggregatorCollector));
if (aggregatorCollector != null) {