If I update an Hibernate entity, all the indexed fields are re-indexed? Well, perhaps this is not the question because I have seen this is true. Lucene can't update a Document, but you need to delete it and add again with the new values.
My problem is that I have a indexed field marked as @Transient and after the update, this field is missing from Lucene index. This is collateral effect of the delete-and-create "update" method. This @Transient field is used to store the extracted text from a PDF, for example. The whole entity is used to store files, as you can guess. Let's call the entity "StoredFile".
I wonder if is possible to create a custom FieldBridge which get the old indexed field content and copy to the new created Lucene Document. The final objective is to avoid the text extraction from PDF and the following indexing process each time a property of the "StoredFile" changes.
Or perhaps there is a better solution?
|