diff --git a/core/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java b/core/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java index f65597a966b..720fb17ae94 100644 --- a/core/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java +++ b/core/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java @@ -342,6 +342,7 @@ public class TransportSearchAction extends HandledTransportAction mutation.requestCache((randomValueOtherThan(searchRequest.requestCache(), () -> randomBoolean())))); mutators.add(() -> mutation .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))); randomFrom(mutators).run(); return mutation; diff --git a/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java b/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java index 18448b5829c..4cd46fe5076 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java +++ b/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java @@ -104,7 +104,7 @@ public class RandomSearchRequestGenerator { searchRequest.scroll(randomPositiveTimeValue()); } if (randomBoolean()) { - searchRequest.searchType(randomFrom(SearchType.values())); + searchRequest.searchType(randomFrom(SearchType.DFS_QUERY_THEN_FETCH, SearchType.QUERY_THEN_FETCH)); } if (randomBoolean()) { searchRequest.source(randomSearchSourceBuilder.get());