Integrating elastic search with existing spring boot application

I have an under development springboot application and need to use elastic search for items search for items search

I am using spring data elastic search repository implementation

my question is what's the best practice to insert and update data at the elastic search repository

should I apply this via aspect programming or modify the business logic implementation and add the repository save function all

I'd modify the business logic.
An example here:

(Look at the save method).

Thanks @dadoonet

I see many implementation the as you said, but

Doesn't this with the single responsibility principle ?
Why not selecting to implement JPA entity listener and call save at persist event or user aspect oriented programming

It can work. But I honestly prefer to decouple the storage logic vs the search logic.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.