Merge branch 'master' into enhancement/use_shard_bulk_for_single_ops

Original commit: elastic/x-pack-elasticsearch@23761f3e16
This commit is contained in:
Lee Hinman 2017-01-09 16:27:42 -07:00
commit 320ec6716d
4 changed files with 24 additions and 6 deletions

View File

@ -74,8 +74,7 @@ public class WatcherSearchTemplateService extends AbstractComponent {
BytesReference source = request.getSearchSource(); BytesReference source = request.getSearchSource();
if (source != null && source.length() > 0) { if (source != null && source.length() > 0) {
try (XContentParser parser = XContentFactory.xContent(source).createParser(xContentRegistry, source)) { try (XContentParser parser = XContentFactory.xContent(source).createParser(xContentRegistry, source)) {
sourceBuilder.parseXContent(new QueryParseContext(parser, parseFieldMatcher), sourceBuilder.parseXContent(new QueryParseContext(parser, parseFieldMatcher));
searchRequestParsers.suggesters);
searchRequest.source(sourceBuilder); searchRequest.source(sourceBuilder);
} }
} }

View File

@ -144,7 +144,7 @@ public class SearchInputTests extends ESIntegTestCase {
XContentParser parser = createParser(builder); XContentParser parser = createParser(builder);
parser.nextToken(); parser.nextToken();
SearchRequestParsers searchParsers = new SearchRequestParsers(null); SearchRequestParsers searchParsers = new SearchRequestParsers();
SearchInputFactory factory = new SearchInputFactory(Settings.EMPTY, WatcherClientProxy.of(client()), SearchInputFactory factory = new SearchInputFactory(Settings.EMPTY, WatcherClientProxy.of(client()),
searchParsers, xContentRegistry(), scriptService()); searchParsers, xContentRegistry(), scriptService());

View File

@ -288,7 +288,7 @@ public class WatchTests extends ESTestCase {
ActionRegistry actionRegistry = registry(Collections.emptyList(), conditionRegistry, transformRegistry); ActionRegistry actionRegistry = registry(Collections.emptyList(), conditionRegistry, transformRegistry);
Watch.Parser watchParser = new Watch.Parser(settings, triggerService, actionRegistry, inputRegistry, null, Clock.systemUTC()); Watch.Parser watchParser = new Watch.Parser(settings, triggerService, actionRegistry, inputRegistry, null, Clock.systemUTC());
SearchRequestParsers searchParsers = new SearchRequestParsers(null); SearchRequestParsers searchParsers = new SearchRequestParsers();
WatcherSearchTemplateService searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, searchParsers, WatcherSearchTemplateService searchTemplateService = new WatcherSearchTemplateService(settings, scriptService, searchParsers,
xContentRegistry()); xContentRegistry());
@ -409,7 +409,7 @@ public class WatchTests extends ESTestCase {
Map<String, InputFactory> parsers = new HashMap<>(); Map<String, InputFactory> parsers = new HashMap<>();
switch (inputType) { switch (inputType) {
case SearchInput.TYPE: case SearchInput.TYPE:
SearchRequestParsers searchParsers = new SearchRequestParsers(null); SearchRequestParsers searchParsers = new SearchRequestParsers();
parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, searchParsers, xContentRegistry(), scriptService)); parsers.put(SearchInput.TYPE, new SearchInputFactory(settings, client, searchParsers, xContentRegistry(), scriptService));
return new InputRegistry(Settings.EMPTY, parsers); return new InputRegistry(Settings.EMPTY, parsers);
default: default:
@ -457,7 +457,7 @@ public class WatchTests extends ESTestCase {
} }
private TransformRegistry transformRegistry() { private TransformRegistry transformRegistry() {
SearchRequestParsers searchParsers = new SearchRequestParsers(null); SearchRequestParsers searchParsers = new SearchRequestParsers();
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, searchParsers, xContentRegistry(), scriptService)); factories.put(SearchTransform.TYPE, new SearchTransformFactory(settings, client, searchParsers, xContentRegistry(), scriptService));

View File

@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.smoketest;
import org.elasticsearch.test.ESIntegTestCase;
public class PreventFailingBuildIT extends ESIntegTestCase {
public void testSoThatTestsDoNotFail() {
// Noop
// This is required because SmokeTestWatcherClientYamlTestSuiteIT
// requires network access, so if network tests are not enable no
// tests will be run in the entire project and all tests will fail.
}
}