Package org.elasticsearch.action.delete

Examples of org.elasticsearch.action.delete.DeleteRequest


        BulkRequest bulkRequest = new BulkRequest();
        bulkRequest.add(new IndexRequest("bulkindex1", "index1_type", "1").source("text", "hallo1"))
                   .add(new IndexRequest("bulkindex2", "index2_type", "1").source("text", "hallo2"))
                   .add(new IndexRequest("bulkindex2", "index2_type").source("text", "hallo2"))
                   .add(new UpdateRequest("bulkindex2", "index2_type", "2").doc("foo", "bar"))
                   .add(new DeleteRequest("bulkindex2", "index2_type", "3"))
                   .refresh(true);

        client().bulk(bulkRequest).get();
        SearchResponse searchResponse = client().prepareSearch("bulkindex*").get();
        assertHitCount(searchResponse, 3);
View Full Code Here


         * Add to bulk a DeleteRequest
         */
        private void esDelete(String index, String type, String id) throws Exception {
            if (logger.isDebugEnabled()) logger.debug("Deleting from ES " + index + ", " + type + ", " + id);
            if (!closed) {
                bulkProcessor.add(new DeleteRequest(index, type, id));
            } else {
                logger.warn("trying to remove a file while closing river. Document [{}]/[{}]/[{}] has been ignored", index, type, id);
            }
        }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.delete.DeleteRequest

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.