Simplified checks

This commit is contained in:
Martijn van Groningen 2013-08-08 11:33:06 +02:00
parent c7d5881686
commit d450d3b016
2 changed files with 2 additions and 6 deletions

View File

@ -100,9 +100,7 @@ public class PercolatorService extends AbstractComponent {
} }
if (collector.exists()) { if (collector.exists()) {
if (!context.limit) { if (!context.limit || count < context.size) {
matches.add(entry.getKey());
} else if (count < context.size) {
matches.add(entry.getKey()); matches.add(entry.getKey());
} }
count++; count++;

View File

@ -99,9 +99,7 @@ abstract class QueryCollector extends Collector {
collector.reset(); collector.reset();
searcher.search(query, collector); searcher.search(query, collector);
if (collector.exists()) { if (collector.exists()) {
if (!limit) { if (!limit || counter < size) {
matches.add(id);
} else if (counter < size) {
matches.add(id); matches.add(id);
} }
counter++; counter++;