Simplified checks
This commit is contained in:
parent
c7d5881686
commit
d450d3b016
|
@ -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++;
|
||||||
|
|
|
@ -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++;
|
||||||
|
|
Loading…
Reference in New Issue