@Override public void delete(DeleteQuery deleteQuery) { Assert.notNull(deleteQuery.getIndex(), "No index defined for Query"); Assert.notNull(deleteQuery.getType(), "No type define for Query"); client .prepareDeleteByQuery(deleteQuery.getIndex()) .setTypes(deleteQuery.getType()) .setQuery(deleteQuery.getQuery()) .execute() .actionGet(); }
@Override public <T> void delete(DeleteQuery deleteQuery, Class<T> clazz) { ElasticsearchPersistentEntity persistentEntity = getPersistentEntityFor(clazz); client .prepareDeleteByQuery(persistentEntity.getIndexName()) .setTypes(persistentEntity.getIndexType()) .setQuery(deleteQuery.getQuery()) .execute() .actionGet(); }