Examples of RefreshRequestBuilder


Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder

                                .field(__tsField, timestamps[idx])
                                .endObject()));
            }
            bulk.execute().actionGet();
        }
        new RefreshRequestBuilder(client().admin().indices()).execute();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder

  }

  private long refreshRequiredIndex(Set<String> indices) {
    long refreshTime = System.currentTimeMillis();
    if (!indices.isEmpty()) {
      RefreshRequestBuilder refreshRequest = searchClient.prepareRefresh(indices.toArray(new String[indices.size()]))
        .setForce(false);

      RefreshResponse refreshResponse = refreshRequest.get();

      if (refreshResponse.getFailedShards() > 0) {
        LOGGER.warn("{} Shard(s) did not refresh", refreshResponse.getFailedShards());
      }
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder

  SearchClient searchClient = new SearchClient(new Settings(), profiling);

  @Test
  public void refresh() {
    try {
      RefreshRequestBuilder requestBuilder = searchClient.prepareRefresh(IndexDefinition.RULE.getIndexName());
      requestBuilder.get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (Exception e) {
      assertThat(e).isInstanceOf(IllegalStateException.class);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder

  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      RefreshRequestBuilder requestBuilder = searchClient.prepareRefresh(IndexDefinition.RULE.getIndexName());
      requestBuilder.get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (Exception e) {
      assertThat(e).isInstanceOf(IllegalStateException.class);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshRequestBuilder

        execute(RefreshAction.INSTANCE, request, listener);
    }

    @Override
    public RefreshRequestBuilder prepareRefresh(String... indices) {
        return new RefreshRequestBuilder(this).setIndices(indices);
    }
View Full Code Here

Examples of org.elasticsearch.client.action.admin.indices.refresh.RefreshRequestBuilder

    @Override public OptimizeRequestBuilder prepareOptimize(String... indices) {
        return new OptimizeRequestBuilder(this).setIndices(indices);
    }

    @Override public RefreshRequestBuilder prepareRefresh(String... indices) {
        return new RefreshRequestBuilder(this).setIndices(indices);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.