Skip to content

Commit

Permalink
Search API: filter element should not be applied to global facets, cl…
Browse files Browse the repository at this point in the history
…oses elastic#888.
  • Loading branch information
kimchy committed Apr 28, 2011
1 parent 3ff0134 commit fb31f3c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fb31f3c

Please sign in to comment.