In my project we are using Lucene and Hibernate Search/ORM 5.9.2. It works perfectly fine if a table is updated on database, same changes are reflected on ES indexes. But the index for a database view is not updated. Values are present under the database but not under the indexes.
Further, Lets assume I’ve 2 classes A & B and C is the view for A+B. And I’m storing C in my elastic indexes. Once A & B are updated under the Database, is it possible C will get updated. As Im using hibernate search+lucene annotations. When a table is updated under database through hibernate entities, hibernate search is updating the same under the indexes. But this behavior is not happening for views as they are updated on the Sql server side. Please suggest if this could be achieved through lucene/hibernate search.
Please help with the corresponding strategy/logic for implementing this through hibernate search.
Since both Hibernate and StackOverflow use Markdown, it’s just a matter of copy pasting the question to this forum.
Just like posting a link on StackOverflow will lead to your question being removed, the same rules apply when posting a question on the Hibernate forum.
BTW, do you need this view at the database level? Because if you only need it at the Elasticsearch level, you can make C a proper entity having a @OneToOne to A and B and index the content of A and B using @IndexedEmbedded and @ContainedIn on the other side. That would solve your issue with native Hibernate Search.
I do not need this new entity at database level, just need this to be on ES index level. How should I go ahead with this.