Remove ParseFieldMatcher usage from SearchRequest

This commit is contained in:
javanna 2016-12-31 11:47:03 +01:00 committed by Luca Cavanna
parent 45c67b5ee5
commit c06d00dce1
3 changed files with 4 additions and 6 deletions

View File

@ -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));
}
/**

View File

@ -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;
}

View File

@ -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);