Also wrap p/c queries in CustomQueryWrappingFilter in the fquery qparser, because they otherwise p/c queries may work incorrectly.

This commit is contained in:
Martijn van Groningen 2014-03-14 22:53:57 +07:00
parent 7b26e1fbf8
commit d73172c844
1 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import org.apache.lucene.search.QueryWrapperFilter;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.cache.filter.support.CacheKeyFilter;
import org.elasticsearch.index.search.child.CustomQueryWrappingFilter;
import java.io.IOException;
@ -85,7 +86,12 @@ public class FQueryFilterParser implements FilterParser {
if (query == null) {
return null;
}
Filter filter = new QueryWrapperFilter(query);
Filter filter;
if (CustomQueryWrappingFilter.shouldUseCustomQueryWrappingFilter(query)) {
filter = new CustomQueryWrappingFilter(query);
} else {
filter = new QueryWrapperFilter(query);
}
if (cache) {
filter = parseContext.cacheFilter(filter, cacheKey);
}