private void deleteIndex(String indexName) { client.nativeClient().admin().indices().prepareDelete(indexName).get(); }
private void deleteIndex(String index) { Loggers.get(getClass()).info("Drop Elasticsearch index [{}]", index); client.nativeClient().admin().indices().prepareDelete(index).get(); } }
private static void deleteIndexIfExists(String name) { try { DeleteIndexResponse response = SHARED_NODE.client().admin().indices().prepareDelete(name).get(); checkState(response.isAcknowledged(), "Fail to drop the index " + name); } catch (IndexNotFoundException e) { // ignore } }
protected void deleteAll() { node.client().admin().indices().prepareDelete("_all").get(); }
.isExists(); if (exists && newdb) { client.admin().indices().prepareDelete(indexKey).execute().actionGet();
.isExists(); if (exists && newIndex) { client.admin().indices().prepareDelete(indexKey).get();
@Override public void recreateIndex(String indexName) throws IOException { DeleteIndexRequestBuilder dirBuilder = transportClient.admin().indices().prepareDelete(indexName); try { DeleteIndexResponse diResponse = dirBuilder.execute().actionGet(); } catch (IndexNotFoundException ie) { System.out.println("Index not found... that's ok"); } CreateIndexRequestBuilder cirBuilder = transportClient.admin().indices().prepareCreate(indexName); CreateIndexResponse ciResponse = cirBuilder.execute().actionGet(); Assert.assertTrue(ciResponse.isAcknowledged(), "Create index succeeeded"); }
@Override public void destroy() { try { logger.info( "dropping application keyspace" ); dataStaxCluster.getClusterSession() .execute("DROP KEYSPACE "+ CQLUtils.quote(cassandraConfig.getApplicationKeyspace())); dataStaxCluster.waitForSchemaAgreement(); logger.info( "dropping application local keyspace" ); dataStaxCluster.getClusterSession() .execute("DROP KEYSPACE "+ CQLUtils.quote(cassandraConfig.getApplicationLocalKeyspace())); dataStaxCluster.waitForSchemaAgreement(); dataStaxCluster.getClusterSession().close(); // close session so it's meta will get refreshed } catch ( Exception e ) { logger.error("Error dropping application keyspaces: {} error: {}", cassandraConfig.getApplicationKeyspace(), e); } logger.info( "keyspaces dropped" ); logger.info( "dropping indices" ); final EsProvider provider = SpringResource.getInstance().getBean( Injector.class ).getInstance( EsProvider.class ); provider.getClient().admin().indices().prepareDelete( "_all" ).execute().actionGet(); } }
public void deleteIndex() { try { this.getClient().admin().indices().prepareDelete("photon").execute().actionGet(); } catch (IndexNotFoundException e) { // ignore } }
client.admin().indices().prepareDelete(this.indexName).execute() .actionGet(); forceCreate = true;
@Override public Void execute(Client client) throws ElasticsearchException { client.admin().indices().prepareDelete(indices).execute().actionGet(); return null; }
@Override public Void execute(Client client) throws ElasticsearchException { client.admin().indices().prepareDelete(indices).execute().actionGet(); return null; }
@Override public boolean deleteIndex(final String indexName) { return searchClientService.getClient().admin().indices() .prepareDelete(indexName).execute().actionGet() .isAcknowledged(); }
private void deleteIndex(String index) { Loggers.get(getClass()).info("Drop Elasticsearch index [{}]", index); client.nativeClient().admin().indices().prepareDelete(index).get(); } }
@Override public boolean clean(String indexName) { try { DeleteIndexResponse response = client.admin().indices().prepareDelete(indexName).execute().actionGet(); } catch (IndexNotFoundException e) { return false; } return true; }
private void initNativeClient() { esClient = NodeBuilder.nodeBuilder().client(true).node().client(); boolean indexExists = esClient.admin().indices().prepareExists(indexName).execute().actionGet().isExists(); if (indexExists) { esClient.admin().indices().prepareDelete(indexName).execute().actionGet(); } esClient.admin().indices().prepareCreate(indexName).execute().actionGet(); }
private void deleteIndex(final String indexName) { bulkProcessor.flush(); // make sure dangling requests don't resurrect this index IndicesAdminClient indices = indicesAdminClient(); if (indices.prepareExists(indexName).execute().actionGet().isExists()) { indices.prepareDelete(indexName).execute().actionGet(); } }
static void cleanup(boolean resetNode) { if (ElassandraDaemon.instance.node() != null) { DeleteIndexRequestBuilder builder = ElassandraDaemon.instance.node().client().admin().indices().prepareDelete("*"); assertAcked(builder.get()); if (resetNode) { reset(); } } } public static String encodeBasicHeader(final String username, final String password) {
public AcknowledgedResponse deleteIndex(final String index, final BuilderCallback<DeleteIndexRequestBuilder> builder) { final AcknowledgedResponse actionGet = builder .apply(client().admin().indices().prepareDelete(index)) .execute().actionGet(); if (!actionGet.isAcknowledged()) { onFailure("Failed to create " + index + ".", actionGet); } return actionGet; }
@After public void after() { final IndicesAdminClient indices = client.admin().indices(); if(indices.prepareExists(INDEX).execute().actionGet().isExists()) { indices.prepareDelete(INDEX).execute().actionGet(); } } }