Simplified checks
This commit is contained in:
parent
c7d5881686
commit
d450d3b016
|
@ -100,9 +100,7 @@ public class PercolatorService extends AbstractComponent {
|
|||
}
|
||||
|
||||
if (collector.exists()) {
|
||||
if (!context.limit) {
|
||||
matches.add(entry.getKey());
|
||||
} else if (count < context.size) {
|
||||
if (!context.limit || count < context.size) {
|
||||
matches.add(entry.getKey());
|
||||
}
|
||||
count++;
|
||||
|
|
|
@ -99,9 +99,7 @@ abstract class QueryCollector extends Collector {
|
|||
collector.reset();
|
||||
searcher.search(query, collector);
|
||||
if (collector.exists()) {
|
||||
if (!limit) {
|
||||
matches.add(id);
|
||||
} else if (counter < size) {
|
||||
if (!limit || counter < size) {
|
||||
matches.add(id);
|
||||
}
|
||||
counter++;
|
||||
|
|
Loading…
Reference in New Issue