Skip to content

Commit 5717d6e

Browse files
authored
Documentation for bulk errors.
Original Pull Request spring-projects#1982 Closes spring-projects#1981
1 parent bbee64c commit 5717d6e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Diff for: src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java

+7
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public interface DocumentOperations {
164164
* @param queries the queries to execute in bulk
165165
* @param clazz the entity class
166166
* @return the information about the indexed objects
167+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
167168
* @since 4.1
168169
*/
169170
default List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, Class<?> clazz) {
@@ -175,6 +176,7 @@ default List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, Class
175176
*
176177
* @param queries the queries to execute in bulk
177178
* @return the information about of the indexed objects
179+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
178180
*/
179181
default List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, IndexCoordinates index) {
180182
return bulkIndex(queries, BulkOptions.defaultOptions(), index);
@@ -187,6 +189,7 @@ default List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, Index
187189
* @param bulkOptions options to be added to the bulk request
188190
* @param clazz the entity class
189191
* @return the information about of the indexed objects
192+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
190193
* @since 4.1
191194
*/
192195
List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions, Class<?> clazz);
@@ -197,13 +200,15 @@ default List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, Index
197200
* @param queries the queries to execute in bulk
198201
* @param bulkOptions options to be added to the bulk request
199202
* @return the information about of the indexed objects
203+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
200204
*/
201205
List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions, IndexCoordinates index);
202206

203207
/**
204208
* Bulk update all objects. Will do update.
205209
*
206210
* @param queries the queries to execute in bulk
211+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
207212
*/
208213
default void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
209214
bulkUpdate(queries, BulkOptions.defaultOptions(), index);
@@ -214,6 +219,7 @@ default void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
214219
*
215220
* @param clazz the entity class
216221
* @param queries the queries to execute in bulk
222+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
217223
* @since 4.1
218224
*/
219225
void bulkUpdate(List<UpdateQuery> queries, Class<?> clazz);
@@ -223,6 +229,7 @@ default void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
223229
*
224230
* @param queries the queries to execute in bulk
225231
* @param bulkOptions options to be added to the bulk request
232+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
226233
*/
227234
void bulkUpdate(List<UpdateQuery> queries, BulkOptions bulkOptions, IndexCoordinates index);
228235

Diff for: src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ default <T> Flux<T> saveAll(Iterable<T> entities, Class<T> clazz) {
106106

107107
/**
108108
* Index entities in the given {@literal index}. If the {@literal index} is {@literal null} or empty the index name
109-
* provided via entity metadata is used.
109+
* provided via entity metadata is used. On errors returns with
110+
* {@link org.springframework.data.elasticsearch.BulkFailureException} with information about the failed operation
110111
*
111112
* @param entities must not be {@literal null}.
112113
* @param index the target index, must not be {@literal null}
@@ -168,7 +169,8 @@ default <T> Flux<T> saveAll(Iterable<T> entities, IndexCoordinates index) {
168169
<T> Flux<MultiGetItem<T>> multiGet(Query query, Class<T> clazz, IndexCoordinates index);
169170

170171
/**
171-
* Bulk update all objects. Will do update.
172+
* Bulk update all objects. Will do update. On errors returns with
173+
* {@link org.springframework.data.elasticsearch.BulkFailureException} with information about the failed operation
172174
*
173175
* @param queries the queries to execute in bulk
174176
* @since 4.0
@@ -182,6 +184,7 @@ default Mono<Void> bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index)
182184
*
183185
* @param queries the queries to execute in bulk
184186
* @param bulkOptions options to be added to the bulk request
187+
* @throws org.springframework.data.elasticsearch.BulkFailureException with information about the failed operation
185188
* @since 4.0
186189
*/
187190
Mono<Void> bulkUpdate(List<UpdateQuery> queries, BulkOptions bulkOptions, IndexCoordinates index);

0 commit comments

Comments
 (0)