|
17 | 17 |
|
18 | 18 | import org.elasticsearch.client.indices.GetFieldMappingsRequest;
|
19 | 19 | import org.elasticsearch.client.indices.GetFieldMappingsResponse;
|
| 20 | +import org.elasticsearch.index.reindex.UpdateByQueryRequest; |
| 21 | +import org.springframework.data.elasticsearch.core.query.UpdateByQueryResponse; |
20 | 22 | import reactor.core.publisher.Flux;
|
21 | 23 | import reactor.core.publisher.Mono;
|
22 | 24 |
|
@@ -596,6 +598,44 @@ default Mono<BulkByScrollResponse> deleteBy(DeleteByQueryRequest deleteRequest)
|
596 | 598 | */
|
597 | 599 | Mono<BulkByScrollResponse> deleteBy(HttpHeaders headers, DeleteByQueryRequest deleteRequest);
|
598 | 600 |
|
| 601 | + /** |
| 602 | + * Execute a {@link UpdateByQueryRequest} against the {@literal update by query} API. |
| 603 | + * |
| 604 | + * @param consumer never {@literal null}. |
| 605 | + * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html">Update By |
| 606 | + * * Query API on elastic.co</a> |
| 607 | + * @return a {@link Mono} emitting operation response. |
| 608 | + */ |
| 609 | + default Mono<UpdateByQueryResponse> updateBy(Consumer<UpdateByQueryRequest> consumer){ |
| 610 | + |
| 611 | + final UpdateByQueryRequest request = new UpdateByQueryRequest(); |
| 612 | + consumer.accept(request); |
| 613 | + return updateBy(request); |
| 614 | + } |
| 615 | + |
| 616 | + /** |
| 617 | + * Execute a {@link UpdateByQueryRequest} against the {@literal update by query} API. |
| 618 | + * |
| 619 | + * @param updateRequest must not be {@literal null}. |
| 620 | + * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html">Update By |
| 621 | + * * Query API on elastic.co</a> |
| 622 | + * @return a {@link Mono} emitting operation response. |
| 623 | + */ |
| 624 | + default Mono<UpdateByQueryResponse> updateBy(UpdateByQueryRequest updateRequest){ |
| 625 | + return updateBy(HttpHeaders.EMPTY, updateRequest); |
| 626 | + } |
| 627 | + |
| 628 | + /** |
| 629 | + * Execute a {@link UpdateByQueryRequest} against the {@literal update by query} API. |
| 630 | + * |
| 631 | + * @param headers Use {@link HttpHeaders} to provide eg. authentication data. Must not be {@literal null}. |
| 632 | + * @param updateRequest must not be {@literal null}. |
| 633 | + * @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html">Update By |
| 634 | + * * Query API on elastic.co</a> |
| 635 | + * @return a {@link Mono} emitting operation response. |
| 636 | + */ |
| 637 | + Mono<UpdateByQueryResponse> updateBy(HttpHeaders headers, UpdateByQueryRequest updateRequest); |
| 638 | + |
599 | 639 | /**
|
600 | 640 | * Execute a {@link BulkRequest} against the {@literal bulk} API.
|
601 | 641 | *
|
|
0 commit comments