Skip to content

Commit

Permalink
top level filter not resulting in an actual filter is ignored
Browse files Browse the repository at this point in the history
when parsing a filter, we use null to indicate that this filter should not match anything, the top level filter doesn't take it into account
fixes #3356
  • Loading branch information
kimchy committed Jul 19, 2013
1 parent fe4c2a9 commit 74a7c46
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -19,6 +19,8 @@

package org.elasticsearch.search.query;

import org.apache.lucene.search.Filter;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.search.SearchParseElement;
import org.elasticsearch.search.internal.SearchContext;
Expand All @@ -30,6 +32,10 @@ public class FilterParseElement implements SearchParseElement {

@Override
public void parse(XContentParser parser, SearchContext context) throws Exception {
context.parsedFilter(context.queryParserService().parseInnerFilter(parser));
Filter filter = context.queryParserService().parseInnerFilter(parser);
if (filter == null) {
filter = Queries.MATCH_NO_FILTER;
}
context.parsedFilter(filter);
}
}

0 comments on commit 74a7c46

Please sign in to comment.