Search API: filter element should not be applied to global facets, closes #888.

This commit is contained in:
kimchy 2011-04-28 16:16:50 +03:00
parent 19448d7775
commit 0ab8d1f414
1 changed files with 3 additions and 2 deletions

View File

@ -138,9 +138,10 @@ public class ContextIndexSearcher extends ExtendedIndexSearcher {
} }
@Override public void search(Weight weight, Filter filter, Collector collector) throws IOException { @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 // 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()); collector = new FilteredCollector(collector, searchContext.parsedFilter());
} }
if (searchContext.timeout() != null) { if (searchContext.timeout() != null) {