@Override public void configureRestClientBuilder(RestClientBuilder restClientBuilder) { if (maxRetryTimeout != null) { restClientBuilder.setMaxRetryTimeoutMillis(maxRetryTimeout); } if (pathPrefix != null) { restClientBuilder.setPathPrefix(pathPrefix); } }
private void deleteIndex(String indexName) { client.nativeClient().admin().indices().prepareDelete(indexName).get(); }
public ForceMergeRequestBuilder prepareForceMerge(String indexName) { // TODO add proxy for profiling return nativeClient().admin().indices().prepareForceMerge(indexName) .setMaxNumSegments(1); }
private static void updateSettings(BulkIndexer bulkIndexer, Map<String, Object> settings) { UpdateSettingsRequestBuilder req = bulkIndexer.client.nativeClient().admin().indices().prepareUpdateSettings(bulkIndexer.indexType.getIndex()); req.setSettings(settings); req.get(); } }
@Override public void close() { nativeClient.close(); } }
@Override public void refresh(String indexName) { Assert.notNull(indexName, "No index defined for refresh()"); try { // TODO: Do something with the response. client.indices().refresh(refreshRequest(indexName)); } catch (IOException e) { throw new ElasticsearchException("failed to refresh index: " + indexName, e); } }
@Override public GetResponse get(GetRequest getRequest) throws IOException { return highLevelClient.get(getRequest); }
private void disposeClient() { if ( client != null ) { client.close(); } }
@Override public void close() { if (client != null) { client.close(); } client = null; }
@Override public void close() throws BackendException { if (node != null && !node.isClosed()) { node.close(); } client.close(); }