Skip to content

Instantly share code, notes, and snippets.

@hillmlogica
hillmlogica / SomeClient.java
Created April 19, 2012 10:01
Elastic client hang
public void run(ElasticSearchClient client) throws EnvironmentException {
TimeValue scrollValidityTime = timeValueSeconds(30);
searchRequest.scroll(scrollValidityTime).searchType(SearchType.SCAN);
SearchResponse searchResponse = client.search(searchRequest).actionGet();
long totalSize = searchResponse.getHits().getTotalHits();
long processedHits = searchResponse.getHits().hits().length;
indexQueryResultHandler.handle(searchResponse);
package buckeroo.indexing;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.action.delete.DeleteRequestBuilder;