Percolator: Filtering percolators based on a query can cause wrong matches to be returned, closes #1925.

This commit is contained in:
Shay Banon 2012-05-08 16:55:42 +03:00
parent 927b4385a8
commit 42eda48c15
1 changed files with 3 additions and 2 deletions

View File

@ -401,6 +401,8 @@ public class PercolatorExecutor extends AbstractIndexComponent {
private final Lucene.ExistsCollector collector = new Lucene.ExistsCollector();
private FieldData fieldData;
QueryCollector(ESLogger logger, ImmutableMap<String, Query> queries, IndexSearcher searcher, IndexService percolatorIndex, List<String> matches) {
this.logger = logger;
this.queries = queries;
@ -409,8 +411,6 @@ public class PercolatorExecutor extends AbstractIndexComponent {
this.matches = matches;
}
private FieldData fieldData;
@Override
public void setScorer(Scorer scorer) throws IOException {
}
@ -429,6 +429,7 @@ public class PercolatorExecutor extends AbstractIndexComponent {
}
// run the query
try {
collector.reset();
searcher.search(query, collector);
if (collector.exists()) {
matches.add(id);