diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java index 6cfe2e2e0..36cc39be0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java @@ -164,6 +164,7 @@ public interface DocumentOperations { * @param queries the queries to execute in bulk * @param clazz the entity class * @return the information about the indexed objects + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation * @since 4.1 */ default List bulkIndex(List queries, Class clazz) { @@ -175,6 +176,7 @@ public interface DocumentOperations { * * @param queries the queries to execute in bulk * @return the information about of the indexed objects + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation */ default List bulkIndex(List queries, IndexCoordinates index) { return bulkIndex(queries, BulkOptions.defaultOptions(), index); @@ -187,6 +189,7 @@ public interface DocumentOperations { * @param bulkOptions options to be added to the bulk request * @param clazz the entity class * @return the information about of the indexed objects + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation * @since 4.1 */ List bulkIndex(List queries, BulkOptions bulkOptions, Class clazz); @@ -197,6 +200,7 @@ public interface DocumentOperations { * @param queries the queries to execute in bulk * @param bulkOptions options to be added to the bulk request * @return the information about of the indexed objects + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation */ List bulkIndex(List queries, BulkOptions bulkOptions, IndexCoordinates index); @@ -204,6 +208,7 @@ public interface DocumentOperations { * Bulk update all objects. Will do update. * * @param queries the queries to execute in bulk + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation */ default void bulkUpdate(List queries, IndexCoordinates index) { bulkUpdate(queries, BulkOptions.defaultOptions(), index); @@ -214,6 +219,7 @@ public interface DocumentOperations { * * @param clazz the entity class * @param queries the queries to execute in bulk + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation * @since 4.1 */ void bulkUpdate(List queries, Class clazz); @@ -223,6 +229,7 @@ public interface DocumentOperations { * * @param queries the queries to execute in bulk * @param bulkOptions options to be added to the bulk request + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation */ void bulkUpdate(List queries, BulkOptions bulkOptions, IndexCoordinates index); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java index 20fa0bcfb..f8789d6de 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java @@ -106,7 +106,8 @@ public interface ReactiveDocumentOperations { /** * Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name - * provided via entity metadata is used. + * provided via entity metadata is used. On errors returns with + * {@link org.springframework.data.elasticsearch.BulkFailureException} with information about the failed operation * * @param entities must not be {@literal null}. * @param index the target index, must not be {@literal null} @@ -168,7 +169,8 @@ public interface ReactiveDocumentOperations { Flux> multiGet(Query query, Class clazz, IndexCoordinates index); /** - * Bulk update all objects. Will do update. + * Bulk update all objects. Will do update. On errors returns with + * {@link org.springframework.data.elasticsearch.BulkFailureException} with information about the failed operation * * @param queries the queries to execute in bulk * @since 4.0 @@ -182,6 +184,7 @@ public interface ReactiveDocumentOperations { * * @param queries the queries to execute in bulk * @param bulkOptions options to be added to the bulk request + * @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation * @since 4.0 */ Mono bulkUpdate(List queries, BulkOptions bulkOptions, IndexCoordinates index);