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)) { if (RestActions.hasBodyContent(request)) {
validateQueryRequest.source(RestActions.getRestContent(request)); validateQueryRequest.source(RestActions.getRestContent(request));
} else { } else {
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder(); QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
querySourceBuilder.setQuery(queryBuilder); querySourceBuilder.setQuery(queryBuilder);

View File

@ -81,7 +81,7 @@ public class RestCountAction extends AbstractCatAction {
throw new ElasticsearchException("failed to parse source", e); throw new ElasticsearchException("failed to parse source", e);
} }
} else { } else {
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder(); QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
querySourceBuilder.setQuery(queryBuilder); querySourceBuilder.setQuery(queryBuilder);

View File

@ -85,7 +85,7 @@ public class RestCountAction extends BaseRestHandler {
throw new ElasticsearchException("failed to parse source", e); throw new ElasticsearchException("failed to parse source", e);
} }
} else { } else {
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
countRequest.query(queryBuilder); countRequest.query(queryBuilder);
} }

View File

@ -58,7 +58,7 @@ public class RestExistsAction extends BaseRestHandler {
if (RestActions.hasBodyContent(request)) { if (RestActions.hasBodyContent(request)) {
existsRequest.source(RestActions.getRestContent(request)); existsRequest.source(RestActions.getRestContent(request));
} else { } else {
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder(); QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder();
querySourceBuilder.setQuery(queryBuilder); querySourceBuilder.setQuery(queryBuilder);

View File

@ -158,7 +158,7 @@ public class RestSearchAction extends BaseRestHandler {
public static boolean parseSearchSource(final SearchSourceBuilder searchSourceBuilder, RestRequest request) { public static boolean parseSearchSource(final SearchSourceBuilder searchSourceBuilder, RestRequest request) {
boolean modified = false; boolean modified = false;
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
searchSourceBuilder.query(queryBuilder); searchSourceBuilder.query(queryBuilder);
modified = true; modified = true;

View File

@ -93,7 +93,7 @@ public class RestActions {
builder.endObject(); builder.endObject();
} }
public static QueryBuilder<?> parseQuerySource(RestRequest request) { public static QueryBuilder<?> urlParamsToQueryBuilder(RestRequest request) {
String queryString = request.param("q"); String queryString = request.param("q");
if (queryString == null) { if (queryString == null) {
return null; return null;

View File

@ -82,7 +82,7 @@ public class RestDeleteByQueryAction extends BaseRestHandler {
final QueryBuilder<?> builder = context.parseInnerQueryBuilder(); final QueryBuilder<?> builder = context.parseInnerQueryBuilder();
delete.query(builder); delete.query(builder);
} else { } else {
QueryBuilder<?> queryBuilder = RestActions.parseQuerySource(request); QueryBuilder<?> queryBuilder = RestActions.urlParamsToQueryBuilder(request);
if (queryBuilder != null) { if (queryBuilder != null) {
delete.query(queryBuilder); delete.query(queryBuilder);
} }