|
47 | 47 | import org.elasticsearch.action.search.MultiSearchResponse;
|
48 | 48 | import org.elasticsearch.action.search.SearchRequestBuilder;
|
49 | 49 | import org.elasticsearch.action.search.SearchResponse;
|
50 |
| -import org.elasticsearch.action.update.UpdateRequest; |
51 | 50 | import org.elasticsearch.action.update.UpdateRequestBuilder;
|
52 | 51 | import org.elasticsearch.action.update.UpdateResponse;
|
53 | 52 | import org.elasticsearch.client.Client;
|
@@ -389,8 +388,7 @@ private <T> CloseableIterator<T> doStream(long scrollTimeInMillis, ScrolledPage<
|
389 | 388 | @Override
|
390 | 389 | public long count(Query query, @Nullable Class<?> clazz, IndexCoordinates index) {
|
391 | 390 | Assert.notNull(index, "index must not be null");
|
392 |
| - SearchRequestBuilder searchRequestBuilder = requestFactory.searchRequestBuilderFor(client, query, clazz, |
393 |
| - index); |
| 391 | + SearchRequestBuilder searchRequestBuilder = requestFactory.searchRequestBuilderFor(client, query, clazz, index); |
394 | 392 | searchRequestBuilder.setSize(0);
|
395 | 393 |
|
396 | 394 | return SearchHitsUtil.getTotalCount(searchRequestBuilder.execute().actionGet().getHits());
|
@@ -447,7 +445,6 @@ public UpdateResponse update(UpdateQuery query, IndexCoordinates index) {
|
447 | 445 | return updateRequestBuilder.execute().actionGet();
|
448 | 446 | }
|
449 | 447 |
|
450 |
| - |
451 | 448 | @Override
|
452 | 449 | public void bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions) {
|
453 | 450 |
|
@@ -544,14 +541,8 @@ public boolean deleteIndex(String indexName) {
|
544 | 541 | }
|
545 | 542 |
|
546 | 543 | @Override
|
547 |
| - public String delete(String indexName, String type, String id) { |
548 |
| - return client.prepareDelete(indexName, type, id).execute().actionGet().getId(); |
549 |
| - } |
550 |
| - |
551 |
| - @Override |
552 |
| - public <T> String delete(Class<T> clazz, String id) { |
553 |
| - ElasticsearchPersistentEntity persistentEntity = getPersistentEntityFor(clazz); |
554 |
| - return delete(persistentEntity.getIndexName(), persistentEntity.getIndexType(), id); |
| 544 | + public String delete(String id, IndexCoordinates index) { |
| 545 | + return client.prepareDelete(index.getIndexName(), index.getTypeName(), id).execute().actionGet().getId(); |
555 | 546 | }
|
556 | 547 |
|
557 | 548 | @Override
|
|
0 commit comments