mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-14 08:02:11 +00:00
parent
1e4b70ba6d
commit
f901380766
@ -1096,8 +1096,7 @@ class RequestFactory {
|
||||
|
||||
public UpdateByQueryRequest updateByQueryRequest(UpdateQuery query, IndexCoordinates index) {
|
||||
|
||||
String indexName = index.getIndexName();
|
||||
final UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest(indexName);
|
||||
final UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest(index.getIndexNames());
|
||||
updateByQueryRequest.setScript(getScript(query));
|
||||
|
||||
if (query.getAbortOnVersionConflict() != null) {
|
||||
|
@ -240,7 +240,7 @@ public class ElasticsearchERHLCIntegrationTests extends ElasticsearchIntegration
|
||||
assertThat(fetchSourceContext.excludes()).containsExactlyInAnyOrder("excl");
|
||||
}
|
||||
|
||||
@Test // #1446
|
||||
@Test // #1446, #2191
|
||||
void shouldUseAllOptionsFromUpdateByQuery() throws JSONException {
|
||||
|
||||
Query searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery()) //
|
||||
@ -270,9 +270,10 @@ public class ElasticsearchERHLCIntegrationTests extends ElasticsearchIntegration
|
||||
" }" + " }" + '}';
|
||||
|
||||
// when
|
||||
UpdateByQueryRequest request = getRequestFactory().updateByQueryRequest(updateQuery, IndexCoordinates.of("index"));
|
||||
UpdateByQueryRequest request = getRequestFactory().updateByQueryRequest(updateQuery, IndexCoordinates.of("index1", "index2"));
|
||||
|
||||
// then
|
||||
assertThat(request.indices()).containsExactlyInAnyOrder("index1", "index2");
|
||||
assertThat(request).isNotNull();
|
||||
assertThat(request.getSearchRequest().indicesOptions()).usingRecursiveComparison()
|
||||
.isEqualTo(IndicesOptions.LENIENT_EXPAND_OPEN);
|
||||
|
Loading…
x
Reference in New Issue
Block a user