Fix BWC for query_and_fetch

This commit is contained in:
Jim Ferenczi 2017-05-09 18:51:49 +02:00
parent b8dede06b5
commit b6c714ccc8
3 changed files with 4 additions and 2 deletions

View File

@ -342,6 +342,7 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
aliasFilter, concreteIndexBoosts, searchPhaseController, executor, searchRequest, listener, shardIterators, aliasFilter, concreteIndexBoosts, searchPhaseController, executor, searchRequest, listener, shardIterators,
timeProvider, clusterStateVersion, task); timeProvider, clusterStateVersion, task);
break; break;
case QUERY_AND_FETCH:
case QUERY_THEN_FETCH: case QUERY_THEN_FETCH:
searchAsyncAction = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, connectionLookup, searchAsyncAction = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, connectionLookup,
aliasFilter, concreteIndexBoosts, searchPhaseController, executor, searchRequest, listener, shardIterators, aliasFilter, concreteIndexBoosts, searchPhaseController, executor, searchRequest, listener, shardIterators,

View File

@ -96,7 +96,8 @@ public class SearchRequestTests extends AbstractSearchTestCase {
mutators.add(() -> mutation.requestCache((randomValueOtherThan(searchRequest.requestCache(), () -> randomBoolean())))); mutators.add(() -> mutation.requestCache((randomValueOtherThan(searchRequest.requestCache(), () -> randomBoolean()))));
mutators.add(() -> mutation mutators.add(() -> mutation
.scroll(randomValueOtherThan(searchRequest.scroll(), () -> new Scroll(new TimeValue(randomNonNegativeLong() % 100000))))); .scroll(randomValueOtherThan(searchRequest.scroll(), () -> new Scroll(new TimeValue(randomNonNegativeLong() % 100000)))));
mutators.add(() -> mutation.searchType(randomValueOtherThan(searchRequest.searchType(), () -> randomFrom(SearchType.values())))); mutators.add(() -> mutation.searchType(randomValueOtherThan(searchRequest.searchType(),
() -> randomFrom(SearchType.DFS_QUERY_THEN_FETCH, SearchType.QUERY_THEN_FETCH))));
mutators.add(() -> mutation.source(randomValueOtherThan(searchRequest.source(), this::createSearchSourceBuilder))); mutators.add(() -> mutation.source(randomValueOtherThan(searchRequest.source(), this::createSearchSourceBuilder)));
randomFrom(mutators).run(); randomFrom(mutators).run();
return mutation; return mutation;

View File

@ -104,7 +104,7 @@ public class RandomSearchRequestGenerator {
searchRequest.scroll(randomPositiveTimeValue()); searchRequest.scroll(randomPositiveTimeValue());
} }
if (randomBoolean()) { if (randomBoolean()) {
searchRequest.searchType(randomFrom(SearchType.values())); searchRequest.searchType(randomFrom(SearchType.DFS_QUERY_THEN_FETCH, SearchType.QUERY_THEN_FETCH));
} }
if (randomBoolean()) { if (randomBoolean()) {
searchRequest.source(randomSearchSourceBuilder.get()); searchRequest.source(randomSearchSourceBuilder.get());