rename RestActions.parseQuerySource() to RestActions.urlParamsToQueryBuilder()

This commit is contained in:
Colin Goodheart-Smithe 2015-10-05 14:11:59 +01:00
parent 81491843f1
commit d59e959c80
7 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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