-
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
Map _index in Document and update/delete on the actual index for documents retrieved from an alias #3007
Comments
had no time yet to look into this |
For the first question: There already is the As for the second question to use this when writing to Elasticsearch, I still have to think this over. We cannot just add this, as this would be a breaking change for people already using this annotation (data mght getwritten some place it wasn't meant to). |
Thank you for your response @sothawo. According to the docs, when a property is annotated with In my proposal, I assumed (though I failed to make it explicit) to use a new annotation (maybe just |
You're right, I though it is set as well after a search. Changing the code to add the value which is alrfeady available in the Still not sure if using this when saving is a good idea, have to do some research about possible problems. To add it by adding an additional parameter was my thought as well, so it would not break existing behaviour on writing. |
The documentation needs an adjustment. I just found that a property annotated with That leaves the writing part. I'll take care of that, but it might take some time (day-time job, hobbies, family and things like that) |
Uh nice! I guess you could call that an unintended feature :v About the writing part, with the annotation working as it does now, I think it can be achieved easily by overriding the Edit: while overriding methods in Edit: grammar and formatting. |
You'd need to write a repository fragment that implements these I have on a local branch added the tests and adapted the documentation, thought first about to just merge that, but I will keep it until I have the saving implemented as well. |
Thank you very much for pointing me in the right direction! |
Closes spring-projects#3007 Signed-off-by: Peter-Josef Meisch <[email protected]>
Closes spring-projects#3007 Signed-off-by: Peter-Josef Meisch <[email protected]>
First of all, apologies if this was already asked. I have tried to fiend other issues detailing this problem, but I have only found #2112, which seems similar but not the same.
We have a big index which is only going to grow, so we want to reindex it to an alias which points to a set of indices with automatic rollover.
We would like to only interact with the indices using the alias, but we need to update and delete specific documents in any of the indices, which Elasticsearch does not allow through the alias due to possible _id conflicts. This means that in our application we will have to manually retrieve the _index from each SearchHit and then call
ElasticsearchRestTemplate.update
orElasticsearchRestTemplate.delete
with the appropriate index coordinates.I was wondering if it would be possible to:
@Id
annotation (this means we would not need to get it manually from the SearchHits);@Document
annotation).The second point would also apply to repositories.
We are evaluating the possibility of extending ElasticsearchRestTemplate to override methods and include the functionality described above.
Please let me know if this sounds as a reasonable suggestion!
The text was updated successfully, but these errors were encountered: