Remove ParseFieldMatcher usage from SearchRequest
This commit is contained in:
parent
45c67b5ee5
commit
c06d00dce1
|
@ -199,7 +199,7 @@ public final class SearchRequest extends ActionRequest implements IndicesRequest
|
|||
* "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch".
|
||||
*/
|
||||
public SearchRequest searchType(String searchType) {
|
||||
return searchType(SearchType.fromString(searchType, ParseFieldMatcher.EMPTY));
|
||||
return searchType(SearchType.fromString(searchType));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import org.elasticsearch.common.ParseFieldMatcher;
|
||||
|
||||
/**
|
||||
* Search type represent the manner at which the search operation is executed.
|
||||
*
|
||||
|
@ -91,7 +89,7 @@ public enum SearchType {
|
|||
* one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch",
|
||||
* "query_then_fetch"/"queryThenFetch" and "query_and_fetch"/"queryAndFetch".
|
||||
*/
|
||||
public static SearchType fromString(String searchType, ParseFieldMatcher parseFieldMatcher) {
|
||||
public static SearchType fromString(String searchType) {
|
||||
if (searchType == null) {
|
||||
return SearchType.DEFAULT;
|
||||
}
|
||||
|
|
|
@ -101,8 +101,8 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
// from the REST layer. these modes are an internal optimization and should
|
||||
// not be specified explicitly by the user.
|
||||
String searchType = request.param("search_type");
|
||||
if (SearchType.fromString(searchType, parseFieldMatcher).equals(SearchType.QUERY_AND_FETCH) ||
|
||||
SearchType.fromString(searchType, parseFieldMatcher).equals(SearchType.DFS_QUERY_AND_FETCH)) {
|
||||
if (SearchType.fromString(searchType).equals(SearchType.QUERY_AND_FETCH) ||
|
||||
SearchType.fromString(searchType).equals(SearchType.DFS_QUERY_AND_FETCH)) {
|
||||
throw new IllegalArgumentException("Unsupported search type [" + searchType + "]");
|
||||
} else {
|
||||
searchRequest.searchType(searchType);
|
||||
|
|
Loading…
Reference in New Issue