-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement update by query [DATAES-873] #1446
Comments
Currently there are these methods defined:
and
The In order to add the additional possibility to do an update by query one solution would be:
This solution would not need any change to the existing API, only the Note: need to check if the return type still is ok |
In The missing fields are the commented setter in the following method public UpdateByQueryRequest updateByQueryRequest(UpdateQuery query, IndexCoordinates index) {
String indexName = index.getIndexName();
final UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest(indexName);
if (query.getScript() != null) {
Map<String, Object> params = query.getParams();
if (params == null) {
params = new HashMap<>();
}
Script script = new Script(ScriptType.INLINE, query.getLang(), query.getScript(), params);
updateByQueryRequest.setScript(script);
}
updateByQueryRequest
//.setAbortOnVersionConflict()
//.setBatchSize()
.setIndicesOptions(query.getQuery().getIndicesOptions())
//.setMaxDocs()
//.setMaxRetries()
//.setPipeline()
.setQuery(getQuery(query.getQuery()))
//.setRefresh()
//.setRequestsPerSecond()
.setRouting(query.getRouting())
.setScroll(TimeValue.timeValueMillis(query.getQuery().getScrollTime().toMillis()))
//.setShouldStoreResult()
//.setSlices()
.setTimeout(query.getTimeout())
.setWaitForActiveShards(ActiveShardCount.parseString(query.getWaitForActiveShards()));
return updateByQueryRequest;
} |
yes, add what is needed to build the request |
Regarding the response, it is more detailed according to the elasticsearch doc responseBody. Is it necessary to have a mirroring object of the elasticsearch response? |
as for the properties that are not yet in the the return type: yes, we should definitely mirror the returned properties instead of passing out original Elasticsearch classes. One of the reasons is currently a topic: Elastic changes the license for Elasticsearch from the next version on (7.11). If Spring Data Elasticsearch encapsulates all the ES classes, our users only use the |
sothawo opened DATAES-873 and commented
Currently we only can update documents with a given id. Additionally we should add the update by query feature which allows to update multiple documents by issuing a query and script
Reference URL: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html
The text was updated successfully, but these errors were encountered: