Merge pull request elastic/elasticsearch#3112 from rjernst/search_parser
Use consolidated search parsers container Original commit: elastic/x-pack-elasticsearch@ff9b62b7dd
This commit is contained in:
commit
8e3640e77f
|
@ -49,6 +49,7 @@ import org.elasticsearch.plugins.ScriptPlugin;
|
||||||
import org.elasticsearch.rest.RestHandler;
|
import org.elasticsearch.rest.RestHandler;
|
||||||
import org.elasticsearch.script.ScriptContext;
|
import org.elasticsearch.script.ScriptContext;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
|
@ -204,7 +205,8 @@ public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin, I
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
|
public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
|
||||||
ResourceWatcherService resourceWatcherService, ScriptService scriptService) {
|
ResourceWatcherService resourceWatcherService, ScriptService scriptService,
|
||||||
|
SearchRequestParsers searchRequestParsers) {
|
||||||
List<Object> components = new ArrayList<>();
|
List<Object> components = new ArrayList<>();
|
||||||
final InternalClient internalClient = new InternalClient(settings, threadPool, client, security.getCryptoService());
|
final InternalClient internalClient = new InternalClient(settings, threadPool, client, security.getCryptoService());
|
||||||
components.add(internalClient);
|
components.add(internalClient);
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.index.query.QueryParseContext;
|
import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||||
import org.elasticsearch.search.suggest.Suggesters;
|
import org.elasticsearch.search.suggest.Suggesters;
|
||||||
import org.elasticsearch.xpack.security.InternalClient;
|
import org.elasticsearch.xpack.security.InternalClient;
|
||||||
|
@ -31,28 +32,24 @@ public class SearchInputFactory extends InputFactory<SearchInput, SearchInput.Re
|
||||||
|
|
||||||
private final WatcherClientProxy client;
|
private final WatcherClientProxy client;
|
||||||
private final TimeValue defaultTimeout;
|
private final TimeValue defaultTimeout;
|
||||||
private final IndicesQueriesRegistry queryRegistry;
|
private final SearchRequestParsers searchRequestParsers;
|
||||||
private final AggregatorParsers aggParsers;
|
|
||||||
private final Suggesters suggesters;
|
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
private final ParseFieldMatcher parseFieldMatcher;
|
||||||
private final WatcherSearchTemplateService searchTemplateService;
|
private final WatcherSearchTemplateService searchTemplateService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SearchInputFactory(Settings settings, InternalClient client, IndicesQueriesRegistry queryRegistry,
|
public SearchInputFactory(Settings settings, InternalClient client,
|
||||||
AggregatorParsers aggParsers, Suggesters suggesters, ScriptService scriptService) {
|
SearchRequestParsers searchRequestParsers, ScriptService scriptService) {
|
||||||
this(settings, new WatcherClientProxy(settings, client), queryRegistry, aggParsers, suggesters, scriptService);
|
this(settings, new WatcherClientProxy(settings, client), searchRequestParsers, scriptService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SearchInputFactory(Settings settings, WatcherClientProxy client, IndicesQueriesRegistry queryRegistry,
|
public SearchInputFactory(Settings settings, WatcherClientProxy client,
|
||||||
AggregatorParsers aggParsers, Suggesters suggesters, ScriptService scriptService) {
|
SearchRequestParsers searchRequestParsers, ScriptService scriptService) {
|
||||||
super(Loggers.getLogger(ExecutableSimpleInput.class, settings));
|
super(Loggers.getLogger(ExecutableSimpleInput.class, settings));
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.queryRegistry = queryRegistry;
|
this.searchRequestParsers = searchRequestParsers;
|
||||||
this.aggParsers = aggParsers;
|
|
||||||
this.suggesters = suggesters;
|
|
||||||
this.defaultTimeout = settings.getAsTime("xpack.watcher.input.search.default_timeout", null);
|
this.defaultTimeout = settings.getAsTime("xpack.watcher.input.search.default_timeout", null);
|
||||||
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, queryRegistry, aggParsers, suggesters);
|
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, searchRequestParsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,8 +59,8 @@ public class SearchInputFactory extends InputFactory<SearchInput, SearchInput.Re
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SearchInput parseInput(String watchId, XContentParser parser) throws IOException {
|
public SearchInput parseInput(String watchId, XContentParser parser) throws IOException {
|
||||||
QueryParseContext context = new QueryParseContext(queryRegistry, parser, parseFieldMatcher);
|
QueryParseContext context = new QueryParseContext(searchRequestParsers.queryParsers, parser, parseFieldMatcher);
|
||||||
return SearchInput.parse(watchId, parser, context, aggParsers, suggesters);
|
return SearchInput.parse(watchId, parser, context, searchRequestParsers.aggParsers, searchRequestParsers.suggesters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,7 @@ import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
||||||
import org.elasticsearch.script.CompiledScript;
|
import org.elasticsearch.script.CompiledScript;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
import org.elasticsearch.search.suggest.Suggesters;
|
import org.elasticsearch.search.suggest.Suggesters;
|
||||||
|
@ -42,18 +43,13 @@ public class WatcherSearchTemplateService extends AbstractComponent {
|
||||||
|
|
||||||
private final ScriptService scriptService;
|
private final ScriptService scriptService;
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
private final ParseFieldMatcher parseFieldMatcher;
|
||||||
private final IndicesQueriesRegistry queryRegistry;
|
private final SearchRequestParsers searchRequestParsers;
|
||||||
private final AggregatorParsers aggsParsers;
|
|
||||||
private final Suggesters suggesters;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public WatcherSearchTemplateService(Settings settings, ScriptService scriptService,
|
public WatcherSearchTemplateService(Settings settings, ScriptService scriptService, SearchRequestParsers searchRequestParsers) {
|
||||||
IndicesQueriesRegistry queryRegistry, AggregatorParsers aggregatorParsers, Suggesters suggesters) {
|
|
||||||
super(settings);
|
super(settings);
|
||||||
this.scriptService = scriptService;
|
this.scriptService = scriptService;
|
||||||
this.queryRegistry = queryRegistry;
|
this.searchRequestParsers = searchRequestParsers;
|
||||||
this.aggsParsers = aggregatorParsers;
|
|
||||||
this.suggesters = suggesters;
|
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +114,8 @@ public class WatcherSearchTemplateService extends AbstractComponent {
|
||||||
BytesReference source = (BytesReference) scriptService.executable(compiledScript, template.params()).run();
|
BytesReference source = (BytesReference) scriptService.executable(compiledScript, template.params()).run();
|
||||||
if (source != null && source.length() > 0) {
|
if (source != null && source.length() > 0) {
|
||||||
try (XContentParser parser = XContentFactory.xContent(source).createParser(source)) {
|
try (XContentParser parser = XContentFactory.xContent(source).createParser(source)) {
|
||||||
sourceBuilder.parseXContent(new QueryParseContext(queryRegistry, parser, parseFieldMatcher), aggsParsers, suggesters);
|
sourceBuilder.parseXContent(new QueryParseContext(searchRequestParsers.queryParsers, parser, parseFieldMatcher),
|
||||||
|
searchRequestParsers.aggParsers, searchRequestParsers.suggesters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourceBuilder;
|
return sourceBuilder;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.index.query.QueryParseContext;
|
import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||||
import org.elasticsearch.search.suggest.Suggesters;
|
import org.elasticsearch.search.suggest.Suggesters;
|
||||||
import org.elasticsearch.xpack.security.InternalClient;
|
import org.elasticsearch.xpack.security.InternalClient;
|
||||||
|
@ -30,27 +31,23 @@ public class SearchTransformFactory extends TransformFactory<SearchTransform, Se
|
||||||
|
|
||||||
protected final WatcherClientProxy client;
|
protected final WatcherClientProxy client;
|
||||||
private final TimeValue defaultTimeout;
|
private final TimeValue defaultTimeout;
|
||||||
private final IndicesQueriesRegistry queryRegistry;
|
private final SearchRequestParsers searchRequestParsers;
|
||||||
private final AggregatorParsers aggParsers;
|
|
||||||
private final Suggesters suggesters;
|
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
private final ParseFieldMatcher parseFieldMatcher;
|
||||||
private final WatcherSearchTemplateService searchTemplateService;
|
private final WatcherSearchTemplateService searchTemplateService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SearchTransformFactory(Settings settings, InternalClient client, IndicesQueriesRegistry queryRegistry,
|
public SearchTransformFactory(Settings settings, InternalClient client,
|
||||||
AggregatorParsers aggParsers, Suggesters suggesters, ScriptService scriptService) {
|
SearchRequestParsers searchRequestParsers, ScriptService scriptService) {
|
||||||
this(settings, new WatcherClientProxy(settings, client), queryRegistry, aggParsers, suggesters, scriptService);
|
this(settings, new WatcherClientProxy(settings, client), searchRequestParsers, scriptService);
|
||||||
}
|
}
|
||||||
public SearchTransformFactory(Settings settings, WatcherClientProxy client, IndicesQueriesRegistry queryRegistry,
|
public SearchTransformFactory(Settings settings, WatcherClientProxy client,
|
||||||
AggregatorParsers aggParsers, Suggesters suggesters, ScriptService scriptService) {
|
SearchRequestParsers searchRequestParsers, ScriptService scriptService) {
|
||||||
super(Loggers.getLogger(ExecutableSearchTransform.class, settings));
|
super(Loggers.getLogger(ExecutableSearchTransform.class, settings));
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
||||||
this.queryRegistry = queryRegistry;
|
this.searchRequestParsers = searchRequestParsers;
|
||||||
this.aggParsers = aggParsers;
|
|
||||||
this.suggesters = suggesters;
|
|
||||||
this.defaultTimeout = settings.getAsTime("xpack.watcher.transform.search.default_timeout", null);
|
this.defaultTimeout = settings.getAsTime("xpack.watcher.transform.search.default_timeout", null);
|
||||||
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, queryRegistry, aggParsers, suggesters);
|
this.searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, searchRequestParsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,8 +57,8 @@ public class SearchTransformFactory extends TransformFactory<SearchTransform, Se
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SearchTransform parseTransform(String watchId, XContentParser parser) throws IOException {
|
public SearchTransform parseTransform(String watchId, XContentParser parser) throws IOException {
|
||||||
QueryParseContext context = new QueryParseContext(queryRegistry, parser, parseFieldMatcher);
|
QueryParseContext context = new QueryParseContext(searchRequestParsers.queryParsers, parser, parseFieldMatcher);
|
||||||
return SearchTransform.parse(watchId, parser, context, aggParsers, suggesters);
|
return SearchTransform.parse(watchId, parser, context, searchRequestParsers.aggParsers, searchRequestParsers.suggesters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,6 +19,7 @@ import org.elasticsearch.plugins.ScriptPlugin;
|
||||||
import org.elasticsearch.script.MockMustacheScriptEngine;
|
import org.elasticsearch.script.MockMustacheScriptEngine;
|
||||||
import org.elasticsearch.script.ScriptContext;
|
import org.elasticsearch.script.ScriptContext;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
import org.elasticsearch.search.suggest.Suggesters;
|
import org.elasticsearch.search.suggest.Suggesters;
|
||||||
|
@ -164,8 +165,9 @@ public class SearchInputTests extends ESIntegTestCase {
|
||||||
parser.nextToken();
|
parser.nextToken();
|
||||||
|
|
||||||
IndicesQueriesRegistry indicesQueryRegistry = internalCluster().getInstance(IndicesQueriesRegistry.class);
|
IndicesQueriesRegistry indicesQueryRegistry = internalCluster().getInstance(IndicesQueriesRegistry.class);
|
||||||
SearchInputFactory factory = new SearchInputFactory(Settings.EMPTY, WatcherClientProxy.of(client()), indicesQueryRegistry,
|
SearchRequestParsers searchParsers = new SearchRequestParsers(indicesQueryRegistry, null, null);
|
||||||
null, null, scriptService());
|
SearchInputFactory factory = new SearchInputFactory(Settings.EMPTY, WatcherClientProxy.of(client()),
|
||||||
|
searchParsers, scriptService());
|
||||||
|
|
||||||
SearchInput searchInput = factory.parseInput("_id", parser);
|
SearchInput searchInput = factory.parseInput("_id", parser);
|
||||||
assertEquals(SearchInput.TYPE, searchInput.type());
|
assertEquals(SearchInput.TYPE, searchInput.type());
|
||||||
|
@ -176,9 +178,7 @@ public class SearchInputTests extends ESIntegTestCase {
|
||||||
String master = internalCluster().getMasterName();
|
String master = internalCluster().getMasterName();
|
||||||
return new WatcherSearchTemplateService(internalCluster().clusterService(master).getSettings(),
|
return new WatcherSearchTemplateService(internalCluster().clusterService(master).getSettings(),
|
||||||
internalCluster().getInstance(ScriptService.class, master),
|
internalCluster().getInstance(ScriptService.class, master),
|
||||||
internalCluster().getInstance(IndicesQueriesRegistry.class, master),
|
internalCluster().getInstance(SearchRequestParsers.class, master)
|
||||||
internalCluster().getInstance(AggregatorParsers.class, master),
|
|
||||||
internalCluster().getInstance(Suggesters.class, master)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.elasticsearch.plugins.ScriptPlugin;
|
||||||
import org.elasticsearch.script.MockMustacheScriptEngine;
|
import org.elasticsearch.script.MockMustacheScriptEngine;
|
||||||
import org.elasticsearch.script.ScriptContext;
|
import org.elasticsearch.script.ScriptContext;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
import org.elasticsearch.search.aggregations.AggregatorParsers;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
import org.elasticsearch.search.suggest.Suggesters;
|
import org.elasticsearch.search.suggest.Suggesters;
|
||||||
|
@ -214,9 +215,9 @@ public class SearchTransformTests extends ESIntegTestCase {
|
||||||
XContentParser parser = JsonXContent.jsonXContent.createParser(builder.bytes());
|
XContentParser parser = JsonXContent.jsonXContent.createParser(builder.bytes());
|
||||||
parser.nextToken();
|
parser.nextToken();
|
||||||
|
|
||||||
IndicesQueriesRegistry indicesQueryRegistry = internalCluster().getInstance(IndicesQueriesRegistry.class);
|
SearchRequestParsers searchRequestParsers = internalCluster().getInstance(SearchRequestParsers.class);
|
||||||
SearchTransformFactory transformFactory = new SearchTransformFactory(Settings.EMPTY, WatcherClientProxy.of(client()),
|
SearchTransformFactory transformFactory = new SearchTransformFactory(Settings.EMPTY, WatcherClientProxy.of(client()),
|
||||||
indicesQueryRegistry, null, null, scriptService());
|
searchRequestParsers, scriptService());
|
||||||
ExecutableSearchTransform executable = transformFactory.parseExecutable("_id", parser);
|
ExecutableSearchTransform executable = transformFactory.parseExecutable("_id", parser);
|
||||||
|
|
||||||
assertThat(executable, notNullValue());
|
assertThat(executable, notNullValue());
|
||||||
|
@ -293,9 +294,7 @@ public class SearchTransformTests extends ESIntegTestCase {
|
||||||
String master = internalCluster().getMasterName();
|
String master = internalCluster().getMasterName();
|
||||||
return new WatcherSearchTemplateService(internalCluster().clusterService(master).getSettings(),
|
return new WatcherSearchTemplateService(internalCluster().clusterService(master).getSettings(),
|
||||||
internalCluster().getInstance(ScriptService.class, master),
|
internalCluster().getInstance(ScriptService.class, master),
|
||||||
internalCluster().getInstance(IndicesQueriesRegistry.class, master),
|
internalCluster().getInstance(SearchRequestParsers.class, master)
|
||||||
internalCluster().getInstance(AggregatorParsers.class, master),
|
|
||||||
internalCluster().getInstance(Suggesters.class, master)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.elasticsearch.index.query.QueryParser;
|
||||||
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
||||||
import org.elasticsearch.license.XPackLicenseState;
|
import org.elasticsearch.license.XPackLicenseState;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
|
import org.elasticsearch.search.SearchRequestParsers;
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.xpack.common.http.HttpClient;
|
import org.elasticsearch.xpack.common.http.HttpClient;
|
||||||
import org.elasticsearch.xpack.common.http.HttpMethod;
|
import org.elasticsearch.xpack.common.http.HttpMethod;
|
||||||
|
@ -351,7 +352,8 @@ public class WatchTests extends ESTestCase {
|
||||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry();
|
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry();
|
||||||
QueryParser<MatchAllQueryBuilder> queryParser = MatchAllQueryBuilder::fromXContent;
|
QueryParser<MatchAllQueryBuilder> queryParser = MatchAllQueryBuilder::fromXContent;
|
||||||
queryRegistry.register(queryParser, MatchAllQueryBuilder.NAME);
|
queryRegistry.register(queryParser, MatchAllQueryBuilder.NAME);
|
||||||
parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, queryRegistry, null, null, scriptService));
|
SearchRequestParsers searchParsers = new SearchRequestParsers(queryRegistry, null, null);
|
||||||
|
parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, searchParsers, scriptService));
|
||||||
return new InputRegistry(Settings.EMPTY, parsers);
|
return new InputRegistry(Settings.EMPTY, parsers);
|
||||||
default:
|
default:
|
||||||
parsers.put(SimpleInput.TYPE, new SimpleInputFactory(settings));
|
parsers.put(SimpleInput.TYPE, new SimpleInputFactory(settings));
|
||||||
|
@ -424,9 +426,10 @@ public class WatchTests extends ESTestCase {
|
||||||
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry();
|
IndicesQueriesRegistry queryRegistry = new IndicesQueriesRegistry();
|
||||||
QueryParser<MatchAllQueryBuilder> queryParser = MatchAllQueryBuilder::fromXContent;
|
QueryParser<MatchAllQueryBuilder> queryParser = MatchAllQueryBuilder::fromXContent;
|
||||||
queryRegistry.register(queryParser, MatchAllQueryBuilder.NAME);
|
queryRegistry.register(queryParser, MatchAllQueryBuilder.NAME);
|
||||||
|
SearchRequestParsers searchParsers = new SearchRequestParsers(queryRegistry, null, null);
|
||||||
Map<String, TransformFactory> factories = new HashMap<>();
|
Map<String, TransformFactory> factories = new HashMap<>();
|
||||||
factories.put(ScriptTransform.TYPE, new ScriptTransformFactory(settings, scriptService));
|
factories.put(ScriptTransform.TYPE, new ScriptTransformFactory(settings, scriptService));
|
||||||
factories.put(SearchTransform.TYPE, new SearchTransformFactory(settings, client, queryRegistry, null, null, scriptService));
|
factories.put(SearchTransform.TYPE, new SearchTransformFactory(settings, client, searchParsers, scriptService));
|
||||||
TransformRegistry registry = new TransformRegistry(Settings.EMPTY, unmodifiableMap(factories));
|
TransformRegistry registry = new TransformRegistry(Settings.EMPTY, unmodifiableMap(factories));
|
||||||
return registry;
|
return registry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue