reuse exists collector

This commit is contained in:
kimchy 2011-05-16 18:08:04 +03:00
parent 671b48e007
commit ff09c19ae6
2 changed files with 6 additions and 1 deletions

View File

@ -417,6 +417,10 @@ public class Lucene {
private boolean exists;
public void reset() {
exists = false;
}
public boolean exists() {
return exists;
}

View File

@ -340,8 +340,9 @@ public class PercolatorExecutor extends AbstractIndexComponent {
List<String> matches = new ArrayList<String>();
if (request.query() == null) {
Lucene.ExistsCollector collector = new Lucene.ExistsCollector();
for (Map.Entry<String, Query> entry : queries.entrySet()) {
Lucene.ExistsCollector collector = new Lucene.ExistsCollector();
collector.reset();
try {
searcher.search(entry.getValue(), collector);
} catch (IOException e) {