private long countBeforeES5X(String indexAndType, String shardId, QueryBuilder query) { StringBuilder uri = new StringBuilder(indexAndType); uri.append("/_count"); if (StringUtils.hasLength(shardId)) { uri.append("?preference=_shards:"); uri.append(shardId); } Response response = execute(GET, uri.toString(), searchRequest(query)); Number count = (Number) parseContent(response.body(), "count"); return (count != null ? count.longValue() : -1); }
uri.append(shardId); Response response = execute(GET, uri.toString(), searchRequest(query)); Map<String, Object> content = parseContent(response.body(), "hits");
private long countBeforeES5X(String indexAndType, String shardId, QueryBuilder query) { StringBuilder uri = new StringBuilder(indexAndType); uri.append("/_count"); if (StringUtils.hasLength(shardId)) { uri.append("?preference=_shards:"); uri.append(shardId); } Response response = execute(GET, uri.toString(), searchRequest(query)); Number count = (Number) parseContent(response.body(), "count"); return (count != null ? count.longValue() : -1); }
private long countBeforeES5X(String indexAndType, String shardId, QueryBuilder query) { StringBuilder uri = new StringBuilder(indexAndType); uri.append("/_count"); if (StringUtils.hasLength(shardId)) { uri.append("?preference=_shards:"); uri.append(shardId); } Response response = execute(GET, uri.toString(), searchRequest(query)); Number count = (Number) parseContent(response.body(), "count"); return (count != null ? count.longValue() : -1); }
private long countBeforeES5X(String indexAndType, String shardId, QueryBuilder query) { StringBuilder uri = new StringBuilder(indexAndType); uri.append("/_count"); if (StringUtils.hasLength(shardId)) { uri.append("?preference=_shards:"); uri.append(shardId); } Response response = execute(GET, uri.toString(), searchRequest(query)); Number count = (Number) parseContent(response.body(), "count"); return (count != null ? count.longValue() : -1); }
uri.append(shardId); Response response = execute(GET, uri.toString(), searchRequest(query)); Map<String, Object> content = parseContent(response.body(), "hits");
uri.append(shardId); Response response = execute(GET, uri.toString(), searchRequest(query)); Map<String, Object> content = parseContent(response.body(), "hits");
uri.append(shardId); Response response = execute(GET, uri.toString(), searchRequest(query)); Map<String, Object> content = parseContent(response.body(), "hits");