Closed
Description
Now if we wanna update a document, a UpdateQuery must be constructed manually, but this is a little unnecessary. Especially for the condation that:
- get a document from index;
- update some field of the document;
- write the doc back;
Problems are:
- if write the doc back using
save(ENTITY)
, values of fields which are unmapped in the entity will be discarded; - if write the doc back using
update(UpdateQuery, IndexCoordinates)
, a UpdateQuery and a IndexCoordinates must be constructed manually;
So i think update(T entity)
is necessary, and spring-data-elasticsearch can construct the UpdateQuery and IndexCoordinates automatically, which is very handy.