Quote:
Search is not really build for this use case in mind, but what do you mean with weak reference?
By weak reference I mean that Invoice only store a unique number about the Person and not a Person entity.
Quote:
You just keep the invoice id and load the actual invoice when needed?
Yes.
When the Person's name changed, we fire an event to notify our bridges. The bridge load the corresponding entity(ies) and call index().
Quote:
If you want to apply the technique from the blog you linked, feel free to patch Hibernate Search; it should be easy to add a new UpdateLuceneWork as you mentioned, or even patch the existing one.
I would prefer to implement a "good" approach that can be merged to Hibernate Search (and benefit from others).
Quote:
A better sound approach is what Andrzej Bialecki is proposing for Lucene 4, but it's not ready and he might needs some help if you want to contribute:
https://issues.apache.org/jira/browse/LUCENE-3837Thanks, I will take a look :)
Quote:
What other users - like myself - used to do to workaround this "limitation" of Lucene is to make extensive use of Hibernate's second level cache, so that reloading often needed references to create the updated Document is fast.
Yes you're right... we already use Hibernate's second level cache but with some anti-pattern on top :'(
Thanks for your replies they helped me to rethink my code.
Guillaume.