Permalink
Browse files

Search API: filter element should not be applied to global facets, cl…

…oses #888.
  • Loading branch information...
1 parent 19448d7 commit 0ab8d1f414305101e0a950aad28f7ef1cec87590 @kimchy kimchy committed Apr 28, 2011
View
5 ...s/elasticsearch/src/main/java/org/elasticsearch/search/internal/ContextIndexSearcher.java
@@ -138,9 +138,10 @@ public void processedScope() {
}
@Override public void search(Weight weight, Filter filter, Collector collector) throws IOException {
- if (searchContext.parsedFilter() != null) {
+ if (searchContext.parsedFilter() != null && Scopes.MAIN.equals(processingScope)) {
// this will only get applied to the actual search collector and not
- // to any scoped collectors
+ // to any scoped collectors, also, it will only be applied to the main collector
+ // since that is where the filter should only work
collector = new FilteredCollector(collector, searchContext.parsedFilter());
}
if (searchContext.timeout() != null) {

0 comments on commit 0ab8d1f

Please sign in to comment.