count collector does not throw stop collection

This commit is contained in:
Shay Banon 2011-12-31 16:26:01 +02:00
parent a4e4235d93
commit 370444cb75
1 changed files with 1 additions and 5 deletions

View File

@ -179,11 +179,7 @@ public class QueryPhase implements SearchPhase {
if (searchContext.searchType() == SearchType.COUNT) {
CountCollector countCollector = new CountCollector();
try {
searchContext.searcher().search(query, countCollector);
} catch (ScanCollector.StopCollectingException e) {
// all is well
}
searchContext.searcher().search(query, countCollector);
topDocs = countCollector.topDocs();
} else if (searchContext.searchType() == SearchType.SCAN) {
ScanCollector scanCollector = new ScanCollector(searchContext.from(), searchContext.size(), searchContext.trackScores());