Package org.elasticsearch.action.delete

Examples of org.elasticsearch.action.delete.DeleteResponse


                execute().actionGet();
        return response.getCount();
    }

    public void deleteById(String id) {
        DeleteResponse response = client.prepareDelete(getIndexName(), getIndexType(), id).
                execute().
                actionGet();
    }
View Full Code Here


     * Delete element in index
     * @param indexPath
     * @return
     */
    public static DeleteResponse delete(IndexQueryPath indexPath, String id) {
        DeleteResponse deleteResponse = getDeleteRequestBuilder(indexPath, id)
                .execute()
                .actionGet();

        if (Logger.isDebugEnabled()) {
            Logger.debug("ElasticSearch : Delete " + deleteResponse.toString());
        }

        return deleteResponse;
    }
View Full Code Here

        GetResponse response = template.requestBody("direct:get", indexId, GetResponse.class);
        assertNotNull("response should not be null", response);
        assertNotNull("response source should not be null", response.getSource());

        //now, perform DELETE
        DeleteResponse deleteResponse = template.requestBody("direct:delete", indexId, DeleteResponse.class);
        assertNotNull("response should not be null", deleteResponse);

        //now, verify GET fails to find the indexed value
        response = template.requestBody("direct:get", indexId, GetResponse.class);
        assertNotNull("response should not be null", response);
View Full Code Here

        assertNotNull("response should not be null", response);
        assertNotNull("response source should not be null", response.getSource());

        //now, perform DELETE
        headers.put(ElasticsearchConfiguration.PARAM_OPERATION, ElasticsearchConfiguration.OPERATION_DELETE);
        DeleteResponse deleteResponse = template.requestBodyAndHeaders("direct:start", indexId, headers, DeleteResponse.class);
        assertNotNull("response should not be null", deleteResponse);

        //now, verify GET fails to find the indexed value
        headers.put(ElasticsearchConfiguration.PARAM_OPERATION, ElasticsearchConfiguration.OPERATION_GET_BY_ID);
        response = template.requestBodyAndHeaders("direct:start", indexId, headers, GetResponse.class);
View Full Code Here

            indexType = getEndpoint().getConfig().getIndexType();
        }

        String indexId = exchange.getIn().getBody(String.class);

        DeleteResponse response = client.prepareDelete(indexName, indexType, indexId).execute().actionGet();
        exchange.getIn().setBody(response);
    }
View Full Code Here

      logger.debug("Going to delete datetime value from {} property for space {}. Document name is {}.", propertyName,
          spaceKey, documentName);

    refreshSearchIndex(getRiverIndexName());

    DeleteResponse lastSeqGetResponse = client.prepareDelete(getRiverIndexName(), riverName.name(), documentName)
        .execute().actionGet();
    if (lastSeqGetResponse.isNotFound()) {
      if (logger.isDebugEnabled()) {
        logger.debug("{} document doesn't exist in remote river persistent store", documentName);
      }
      return false;
    } else {
View Full Code Here

      throws Exception {
    Logger.debug("Delete Model: %s", model);
    String indexName = mapper.getIndexName();
    String typeName = mapper.getTypeName();
    String documentId = mapper.getDocumentId(model);
    DeleteResponse response = client.prepareDelete(indexName, typeName, documentId)
        .setOperationThreaded(false).execute().actionGet();
    Logger.debug("Delete Response: %s", response);

  }
View Full Code Here

        this.node = node;
        this.json = json;
    }

    public boolean deleteBySlug(String slug) {
        DeleteResponse deleteResponse = node.client().prepareDelete(INDEX, TYPE, slug).execute().actionGet();
        return !deleteResponse.notFound();
    }
View Full Code Here

      logger.debug("Going to delete datetime value from {} property for space {}. Document name is {}.", propertyName,
          spaceKey, documentName);

    refreshSearchIndex(getRiverIndexName());

    DeleteResponse lastSeqGetResponse = client.prepareDelete(getRiverIndexName(), riverName.name(), documentName)
        .execute().actionGet();
    if (lastSeqGetResponse.isNotFound()) {
      if (logger.isDebugEnabled()) {
        logger.debug("{} document doesn't exist in remote river persistent store", documentName);
      }
      return false;
    } else {
View Full Code Here

   
    String docId = getDocumentId(document);
   
    ListenableActionFuture<DeleteResponse> actionFuture = client.prepareDelete(documentIndex, documentType, docId)
        .execute();
    DeleteResponse response = actionFuture.actionGet(requestTimeout);
    if (response.isNotFound()) {
      logger.debug("Delete failed, document not found");
    }
    else {
      logger.debug("Deleted document with id " + response.getId());
    }
  }
View Full Code Here

TOP

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

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.