Hi,
We have manual indexing (annoying, but its an existing old system, hard to re-design). So our Entities have a "modifiedTime" property, and we periodically query for entities with "modifiedTime>X", and index them.
But obviously this approach fails for *deleted* items (they just don't come up in the query). In the old system nobody minded, because database deletes were rare. Now it's required, and I considered 2 approaches: A) Using logical delete (don't delete the record, just mark it with some flag). B) Maintaining a special table of "deleted entity IDs", so that every "DELETE" will trigger a insertion to this table. C) I'd appreciate any other ideas as well.
Could I please ask what's best from the perspective of Hibernate Search? 1) Are there any subtle design/performance reasons, making one approach better for Hibernate Search? 2) Does Hibernate Search have built-in utilities for it? E.g. built-in flag or event that would cause Hibernate Search to automatically delete those records from the database once they've been indexed (since those records are kept just of the sake of indexing).
Thanks :)
|