Skip to content

update document partially by specified entity #2304

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

Closed
puppylpg opened this issue Sep 22, 2022 · 3 comments
Closed

update document partially by specified entity #2304

puppylpg opened this issue Sep 22, 2022 · 3 comments
Labels
type: enhancement A general enhancement

Comments

@puppylpg
Copy link
Contributor

Now if we wanna update a document, a UpdateQuery must be constructed manually, but this is a little unnecessary. Especially for the condation that:

  1. get a document from index;
  2. update some field of the document;
  3. write the doc back;

Problems are:

  1. if write the doc back using save(ENTITY), values of fields which are unmapped in the entity will be discarded;
  2. 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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 22, 2022
sothawo pushed a commit that referenced this issue Sep 24, 2022
@sothawo sothawo linked a pull request Sep 24, 2022 that will close this issue
5 tasks
@sothawo sothawo closed this as completed Sep 24, 2022
@sothawo
Copy link
Collaborator

sothawo commented Sep 24, 2022

Have to reopen; I noticed, that the PR was targeting the wrong branch. Can you please create a new PR with the changes - then with what I commented and target the main branch?

@sothawo sothawo reopened this Sep 24, 2022
@sothawo sothawo removed a link to a pull request Sep 24, 2022
5 tasks
@puppylpg
Copy link
Contributor Author

Sorry for the wrong branch, and i'll polish and reopen a PR for main

@puppylpg
Copy link
Contributor Author

submited: #2310

@sothawo sothawo added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 25, 2022
@sothawo sothawo added this to the 5.0 RC1 (2022.0.0) milestone Sep 25, 2022
sothawo added a commit that referenced this issue Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants