public boolean delete(String indexOrType) { Request req = new SimpleRequest(DELETE, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); } public boolean deleteScroll(String scrollId) {
private boolean exists(String indexOrType) { Request req = new SimpleRequest(HEAD, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean deleteScroll(String scrollId) { BytesArray body; if (internalVersion.onOrAfter(EsMajorVersion.V_2_X)) { body = new BytesArray(("{\"scroll_id\":[\"" + scrollId + "\"]}").getBytes(StringUtils.UTF_8)); } else { body = new BytesArray(scrollId.getBytes(StringUtils.UTF_8)); } Request req = new SimpleRequest(DELETE, null, "_search/scroll", body); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public List<List<Map<String, Object>>> targetShards(String index, String routing) { List<List<Map<String, Object>>> shardsJson = null; // https://github.com/elasticsearch/elasticsearch/issues/2726 String target = index + "/_search_shards"; if (routing != null) { target += "?routing=" + HttpEncodingTools.encode(routing); } if (indexReadMissingAsEmpty) { Request req = new SimpleRequest(GET, null, target); Response res = executeNotFoundAllowed(req); if (res.status() == HttpStatus.OK) { shardsJson = parseContent(res.body(), "shards"); } else { shardsJson = Collections.emptyList(); } } else { shardsJson = get(target, "shards"); } return shardsJson; }
public boolean delete(String indexOrType) { Request req = new SimpleRequest(DELETE, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); } public boolean deleteScroll(String scrollId) {
public boolean exists(String indexOrType) { Request req = new SimpleRequest(HEAD, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean delete(String indexOrType) { Request req = new SimpleRequest(DELETE, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); } public boolean deleteScroll(String scrollId) {
public boolean delete(String indexOrType) { Request req = new SimpleRequest(DELETE, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); } public boolean deleteScroll(String scrollId) {
public boolean delete(String indexOrType) { Request req = new SimpleRequest(DELETE, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); } public boolean deleteScroll(String scrollId) {
private boolean exists(String indexOrType) { Request req = new SimpleRequest(HEAD, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
private boolean exists(String indexOrType) { Request req = new SimpleRequest(HEAD, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
private boolean exists(String indexOrType) { Request req = new SimpleRequest(HEAD, null, indexOrType); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean deleteScroll(String scrollId) { BytesArray body; if (internalVersion.onOrAfter(EsMajorVersion.V_2_X)) { body = new BytesArray(("{\"scroll_id\":[\"" + scrollId + "\"]}").getBytes(StringUtils.UTF_8)); } else { body = new BytesArray(scrollId.getBytes(StringUtils.UTF_8)); } Request req = new SimpleRequest(DELETE, null, "_search/scroll", body); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean deleteScroll(String scrollId) { BytesArray body; if (internalVersion.onOrAfter(EsMajorVersion.V_2_X)) { body = new BytesArray(("{\"scroll_id\":[\"" + scrollId + "\"]}").getBytes(StringUtils.UTF_8)); } else { body = new BytesArray(scrollId.getBytes(StringUtils.UTF_8)); } Request req = new SimpleRequest(DELETE, null, "_search/scroll", body); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean deleteScroll(String scrollId) { Request req = new SimpleRequest(DELETE, null, "_search/scroll", new BytesArray(scrollId.getBytes(StringUtils.UTF_8))); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public boolean deleteScroll(String scrollId) { BytesArray body; if (internalVersion.onOrAfter(EsMajorVersion.V_2_X)) { body = new BytesArray(("{\"scroll_id\":[\"" + scrollId + "\"]}").getBytes(StringUtils.UTF_8)); } else { body = new BytesArray(scrollId.getBytes(StringUtils.UTF_8)); } Request req = new SimpleRequest(DELETE, null, "_search/scroll", body); Response res = executeNotFoundAllowed(req); return (res.status() == HttpStatus.OK ? true : false); }
public List<List<Map<String, Object>>> targetShards(String index, String routing) { List<List<Map<String, Object>>> shardsJson = null; // https://github.com/elasticsearch/elasticsearch/issues/2726 String target = index + "/_search_shards"; if (routing != null) { target += "?routing=" + StringUtils.encodeQuery(routing); } if (indexReadMissingAsEmpty) { Request req = new SimpleRequest(GET, null, target); Response res = executeNotFoundAllowed(req); if (res.status() == HttpStatus.OK) { shardsJson = parseContent(res.body(), "shards"); } else { shardsJson = Collections.emptyList(); } } else { shardsJson = get(target, "shards"); } return shardsJson; }
public List<List<Map<String, Object>>> targetShards(String index, String routing) { List<List<Map<String, Object>>> shardsJson = null; // https://github.com/elasticsearch/elasticsearch/issues/2726 String target = index + "/_search_shards"; if (routing != null) { target += "?routing=" + HttpEncodingTools.encode(routing); } if (indexReadMissingAsEmpty) { Request req = new SimpleRequest(GET, null, target); Response res = executeNotFoundAllowed(req); if (res.status() == HttpStatus.OK) { shardsJson = parseContent(res.body(), "shards"); } else { shardsJson = Collections.emptyList(); } } else { shardsJson = get(target, "shards"); } return shardsJson; }
public List<List<Map<String, Object>>> targetShards(String index, String routing) { List<List<Map<String, Object>>> shardsJson = null; // https://github.com/elasticsearch/elasticsearch/issues/2726 String target = index + "/_search_shards"; if (routing != null) { target += "?routing=" + HttpEncodingTools.encode(routing); } if (indexReadMissingAsEmpty) { Request req = new SimpleRequest(GET, null, target); Response res = executeNotFoundAllowed(req); if (res.status() == HttpStatus.OK) { shardsJson = parseContent(res.body(), "shards"); } else { shardsJson = Collections.emptyList(); } } else { shardsJson = get(target, "shards"); } return shardsJson; }
public List<List<Map<String, Object>>> targetShards(String index, String routing) { List<List<Map<String, Object>>> shardsJson = null; // https://github.com/elasticsearch/elasticsearch/issues/2726 String target = index + "/_search_shards"; if (routing != null) { target += "?routing=" + HttpEncodingTools.encode(routing); } if (indexReadMissingAsEmpty) { Request req = new SimpleRequest(GET, null, target); Response res = executeNotFoundAllowed(req); if (res.status() == HttpStatus.OK) { shardsJson = parseContent(res.body(), "shards"); } else { shardsJson = Collections.emptyList(); } } else { shardsJson = get(target, "shards"); } return shardsJson; }