reuse exists collector
This commit is contained in:
parent
671b48e007
commit
ff09c19ae6
|
@ -417,6 +417,10 @@ public class Lucene {
|
|||
|
||||
private boolean exists;
|
||||
|
||||
public void reset() {
|
||||
exists = false;
|
||||
}
|
||||
|
||||
public boolean exists() {
|
||||
return exists;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue