Add shortcut for AbstractQueryBuilder.parseInnerQueryBuilder to QueryShardContext

This commit is contained in:
Christoph Büscher 2017-06-29 21:38:31 +02:00
parent dd5d165da1
commit c32c21e875
1 changed files with 6 additions and 4 deletions

View File

@ -34,6 +34,7 @@ import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.IndexAnalyzers;
@ -49,11 +50,8 @@ import org.elasticsearch.index.mapper.ObjectMapper;
import org.elasticsearch.index.mapper.TextFieldMapper;
import org.elasticsearch.index.query.support.NestedScope;
import org.elasticsearch.index.similarity.SimilarityService;
import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.script.SearchScript;
import org.elasticsearch.search.lookup.SearchLookup;
import java.io.IOException;
@ -61,7 +59,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.function.LongSupplier;
import static java.util.Collections.unmodifiableMap;
@ -326,6 +323,7 @@ public class QueryShardContext extends QueryRewriteContext {
}
/** Return the script service to allow compiling scripts. */
@Override
public final ScriptService getScriptService() {
failIfFrozen();
return scriptService;
@ -388,4 +386,8 @@ public class QueryShardContext extends QueryRewriteContext {
failIfFrozen(); // we somebody uses a terms filter with lookup for instance can't be cached...
return super.getClient();
}
public QueryBuilder parseInnerQueryBuilder(XContentParser parser) throws IOException {
return AbstractQueryBuilder.parseInnerQueryBuilder(parser);
}
}