Пример #1
0
 public InputStream scroll(String scrollId) throws IOException {
   // use post instead of get to avoid some weird encoding issues (caused by the long URL)
   return execute(
           POST,
           "_search/scroll?scroll=" + scrollKeepAlive.toString(),
           new BytesArray(scrollId.getBytes(StringUtils.UTF_8)))
       .body();
 }
Пример #2
0
  public boolean health(String index, HEALTH health, TimeValue timeout) throws IOException {
    StringBuilder sb = new StringBuilder("/_cluster/health/");
    sb.append(index);
    sb.append("?wait_for_status=");
    sb.append(health.name().toLowerCase(Locale.ENGLISH));
    sb.append("&timeout=");
    sb.append(timeout.toString());

    return (Boolean.TRUE.equals(get(sb.toString(), "timed_out")));
  }