Skip to content

Commit

Permalink
Search: Optimize (perf) execution of global facets, closes elastic#889.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Apr 28, 2011
1 parent 2c0bb91 commit 887ac1f
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -21,7 +21,6 @@

import org.apache.lucene.search.*;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.common.collect.ImmutableList;
import org.elasticsearch.common.collect.ImmutableMap;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.collect.Maps;
Expand All @@ -34,6 +33,7 @@
import org.elasticsearch.search.query.QueryPhaseExecutionException;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -90,11 +90,10 @@ public class FacetPhase implements SearchPhase {
}
List<Collector> list = filtersByCollector.get(filter);
if (list == null) {
list = ImmutableList.of(collector);
list = new ArrayList<Collector>();
filtersByCollector.put(filter, list);
} else {
list.add(collector);
}
list.add(collector);
}
}
// now, go and execute the filters->collector ones
Expand Down

0 comments on commit 887ac1f

Please sign in to comment.