percolator: if size is 0 then use TotalHitCountCollector
Fixes PercolateIT#testPercolateSizingWithQueryAndFilter test
This commit is contained in:
parent
2d6adf6428
commit
247ce06fc3
|
@ -254,7 +254,7 @@ public class PercolatorService extends AbstractComponent {
|
||||||
}
|
}
|
||||||
PercolatorQuery percolatorQuery = builder.build();
|
PercolatorQuery percolatorQuery = builder.build();
|
||||||
|
|
||||||
if (context.isOnlyCount()) {
|
if (context.isOnlyCount() || context.size() == 0) {
|
||||||
TotalHitCountCollector collector = new TotalHitCountCollector();
|
TotalHitCountCollector collector = new TotalHitCountCollector();
|
||||||
context.searcher().search(percolatorQuery, MultiCollector.wrap(collector, aggregatorCollector));
|
context.searcher().search(percolatorQuery, MultiCollector.wrap(collector, aggregatorCollector));
|
||||||
if (aggregatorCollector != null) {
|
if (aggregatorCollector != null) {
|
||||||
|
|
Loading…
Reference in New Issue