rename RestActions.parseQuerySource() to RestActions.urlParamsToQueryBuilder()
This commit is contained in:
parent
81491843f1
commit
d59e959c80
|
@ -67,7 +67,7 @@ public class RestValidateQueryAction extends BaseRestHandler {
|
|||
if (RestActions.hasBodyContent(request)) {
|
||||
validateQueryRequest.source(RestActions.getRestContent(request));
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
|
||||
querySourceBuilder.setQuery(queryBuilder);
|
||||
|
|
|
@ -81,7 +81,7 @@ public class RestCountAction extends AbstractCatAction {
|
|||
throw new ElasticsearchException("failed to parse source", e);
|
||||
}
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
|
||||
querySourceBuilder.setQuery(queryBuilder);
|
||||
|
|
|
@ -85,7 +85,7 @@ public class RestCountAction extends BaseRestHandler {
|
|||
throw new ElasticsearchException("failed to parse source", e);
|
||||
}
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
countRequest.query(queryBuilder);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class RestExistsAction extends BaseRestHandler {
|
|||
if (RestActions.hasBodyContent(request)) {
|
||||
existsRequest.source(RestActions.getRestContent(request));
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
|
||||
querySourceBuilder.setQuery(queryBuilder);
|
||||
|
|
|
@ -158,7 +158,7 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
public static boolean parseSearchSource(final SearchSourceBuilder searchSourceBuilder, RestRequest request) {
|
||||
|
||||
boolean modified = false;
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
searchSourceBuilder.query(queryBuilder);
|
||||
modified = true;
|
||||
|
|
|
@ -93,7 +93,7 @@ public class RestActions {
|
|||
builder.endObject();
|
||||
}
|
||||
|
||||
public static QueryBuilder<?> parseQuerySource(RestRequest request) {
|
||||
public static QueryBuilder<?> urlParamsToQueryBuilder(RestRequest request) {
|
||||
String queryString = request.param("q");
|
||||
if (queryString == null) {
|
||||
return null;
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RestDeleteByQueryAction extends BaseRestHandler {
|
|||
final QueryBuilder<?> builder = context.parseInnerQueryBuilder();
|
||||
delete.query(builder);
|
||||
} else {
|
||||
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request);
|
||||
QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
|
||||
if (queryBuilder != null) {
|
||||
delete.query(queryBuilder);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue