spring-data-elasticsearch
spring-data-elasticsearch copied to clipboard
Only index type possible for bulk inserts, causes error with data-streams
Currently, if you do a saveAll, the IndexQuery is build with OpType INDEX. This causes an error if you want to use it with a data-stream, as only create actions are allowed. Is this somehow planned to be implemented, that you can configure the query type on bulk inserts?
currently it is not possible to set this. I change this issue to a feature request.
Hey @sothawo just wanted to check if this enhancement will be implemented soon? Any update would be appreciated.
Spring Data Elasticsearch is a community driven project, there is no dedicated team anywhere working on it. I as a project lead manage / review contributions and as a maintainer add code myself. But I'm doing this in my spare time. So issues have to wait until either someone from the community contributes or I find the time to implement them.
It was just a question for an update on this issue, no demand that it should be implemented soon. Sorry if that came off wrong at your side. We will, of course, wait for the implementation.
Thanks for your work, appreciate the effort!
just for the record... I stumbled upon this same point (datastream vs the missing optype on saving) and forked that part locally by adding the ability to get the optType from a parameter on Document annotation of a given Entity here https://github.com/spring-projects/spring-data-elasticsearch/blob/7092e04feb906a450170bc5311fae45f8f9cf0db/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java#L582 ...which, obviously, I imagine not be appropriated... but would it be a good idea to allow it to be passed from the annotation to a more appropriate point on the code?
Had no time yet to look intothis, but I think we should not add a detail like opType
on the @Document
annotation, but rather something like dataStream=true
(having a default of false
, and then at the different places where this information is needed - to set the op-type for example - refer to that value.
and something like that? https://github.com/spring-projects/spring-data-elasticsearch/compare/main...koshnarek:spring-data-elasticsearch:main
I,d rather put that as a property on the ElasticsearchPersistentEntity
. I did not check yet, at what places this would be needed to be taken inot account