Remove ParseFieldMatcher usages from QueryRewriteContext
@@ -20,8 +20,6 @@ package org.elasticsearch.index.query;
import org.apache.lucene.index.IndexReader;
import org.elasticsearch.client.Client;
-import org.elasticsearch.common.ParseFieldMatcher;
-import org.elasticsearch.common.ParseFieldMatcherSupplier;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentParser;
@@ -37,7 +35,7 @@ import java.util.function.LongSupplier;
/**
* Context object used to rewrite {@link QueryBuilder} instances into simplified version.
*/
-public class QueryRewriteContext implements ParseFieldMatcherSupplier {
+public class QueryRewriteContext {
protected final MapperService mapperService;
protected final ScriptService scriptService;
protected final IndexSettings indexSettings;
@@ -87,11 +85,6 @@ public class QueryRewriteContext implements ParseFieldMatcherSupplier {
return reader;
}
- @Override
- public ParseFieldMatcher getParseFieldMatcher() {
- return this.indexSettings.getParseFieldMatcher();
- }
-
/**
* The registry used to build new {@link XContentParser}s. Contains registered named parsers needed to parse the query.
*/
@@ -100,8 +93,7 @@ public class QueryRewriteContext implements ParseFieldMatcherSupplier {
}
/**
- * Returns a new {@link QueryParseContext} that wraps the provided parser, using the ParseFieldMatcher settings that
- * are configured in the index settings. The default script language will always default to Painless.
+ * Returns a new {@link QueryParseContext} that wraps the provided parser.
*/
public QueryParseContext newParseContext(XContentParser parser) {
return new QueryParseContext(parser);
@@ -115,6 +107,4 @@ public class QueryRewriteContext implements ParseFieldMatcherSupplier {
ExecutableScript executable = scriptService.executable(template, ScriptContext.Standard.SEARCH);
return (BytesReference) executable.run();
}
-
-
}
