What’s a good approach in which (rough) case?
I have a database that I want to index and I have thought of a few approaches to index it:
- Batch create all my indexes. This is obviously good if I want to initialise a search index on already created and not yet indexed data.
- On creation / deletion of objects, e.g. hooked into ORM event handlers. Very much realtime and I cannot think of any no-cases.
- Scheduled Atomic reindexes, basically an extended approach of 1. with periodical iteration to keep the index as up-to-date as possible
- Queued indexing, where I would track what has been added, removed or updated in my database for the last X hours / days / whatever and then process the appropriate indexing operations on them after another passed time period.