Package org.elasticsearch.action.admin.indices.delete

Examples of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest


        }

    }

    public void delete(String indexName) {
        c.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
    }
View Full Code Here


        }
        LOGGER.info("index %s exists?", indexName);
        IndicesExistsRequest existsRequest = client.admin().indices().prepareExists(indexName).request();
        if (client.admin().indices().exists(existsRequest).actionGet().isExists()) {
            LOGGER.info("index %s exists... deleting!", indexName);
            DeleteIndexResponse response = client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
            if (!response.isAcknowledged()) {
                LOGGER.error("Failed to delete elastic search index named %s", indexName);
            }
        }
        LOGGER.debug("END deleting elastic search index: " + indexName);
View Full Code Here

     * @param index The index to delete
     * @return The delete index request
     * @see org.elasticsearch.client.IndicesAdminClient#delete(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)
     */
    public static DeleteIndexRequest deleteIndexRequest(String index) {
        return new DeleteIndexRequest(index);
    }
View Full Code Here

* @author kimchy (shay.banon)
*/
public class DeleteIndexRequestBuilder extends BaseIndicesRequestBuilder<DeleteIndexRequest, DeleteIndexResponse> {

    public DeleteIndexRequestBuilder(IndicesAdminClient indicesClient, String... indices) {
        super(indicesClient, new DeleteIndexRequest(indices));
    }
View Full Code Here

        controller.registerHandler(RestRequest.Method.DELETE, "/", this);
        controller.registerHandler(RestRequest.Method.DELETE, "/{index}", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(splitIndices(request.param("index")));
        deleteIndexRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        client.admin().indices().delete(deleteIndexRequest, new ActionListener<DeleteIndexResponse>() {
            @Override public void onResponse(DeleteIndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
View Full Code Here

*/
@SuppressWarnings("unused")
public class DeleteIndexRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<DeleteIndexRequest, DeleteIndexResponse, JsonInput, JsonOutput> {

    public DeleteIndexRequestBuilder(Client client, JsonToString<JsonInput> jsonToString, StringToJson<JsonOutput> stringToJson) {
        super(client, new DeleteIndexRequest(), jsonToString, stringToJson);
    }
View Full Code Here

        client.close();
        closeAllNodes();
    }

    @BeforeMethod public void setUp() {
        client.admin().indices().delete(new DeleteIndexRequest("_all")).actionGet();
        Settings emptySettings = ImmutableSettings.settingsBuilder().build();
        action = new ReIndexAction(emptySettings, client, new RestController(emptySettings));
    }
View Full Code Here

           
                long oldCount = client.count(new CountRequest(searchIndexName)).actionGet().getCount();
                long newCount = client.count(new CountRequest(newIndexName)).actionGet().getCount();
                if (oldCount == newCount) {
                    logger.info("deleting " + searchIndexName);
                    client.admin().indices().delete(new DeleteIndexRequest(searchIndexName)).actionGet();
                }
            }

            boolean copyAliases = request.paramAsBoolean("copyAliases", false);
            if (copyAliases)
View Full Code Here

    @After
    public void deleteIndices() {
        logger.info("deleting index {}", INDEX);
        try {
            client("1").admin().indices().delete(new DeleteIndexRequest().indices(INDEX)).actionGet();
        } catch (IndexMissingException e) {
            // ignore
        }
        logger.info("index {} deleted", INDEX);
        closeAllNodes();
View Full Code Here

    try {
      if (null != _childIndexes) {
        _childIndexes.clear();
      }
      _indexes.remove(_sIndexName);
      _elasticClient.admin().indices().delete(new DeleteIndexRequest(_sIndexName)).actionGet();
    }
    catch (Exception e) {
      //Probably fine, just that the index doesn't exist...
      return false;
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest

Copyright © 2018 www.massapicom. 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.