Depending on the scenarios, in some cases reindexing needs to be performed. Currently the reindexing is done by setting the reindex flag to true in the index definition node via CRXDE or via the Index Manager user interface. After the flag is set, reindexing is done asynchronously.
Some points to note around reindexing:
- Reindexing is lot slower on DocumentNodeStore setups compared to SegmentNodeStore setups where all content is local;
- With the current design, while reindexing happens the async indexer is blocked and all other async indexes become stale and do not get update for the duration of indexing. Because of this, if the system is in use, users may not see up to date results;
- Reindexing involves traversal of the whole repository which can put a high load on the AEM setup and thus impact end user experience;
- For a DocumentNodeStore installation where reindexing might take a considerable amount of time, if the connection to the Mongo database fails in the middle of the operation, indexing would have to be restarted from scratch;
- In some cases reindexing can take long time because of text extraction. This is mainly specific for setups having lots of PDF files, where the time spent on text extraction can impact indexing time.
To meet these objectives the oak-run index tooling supports different modes for reindexing which can be used as required. The oak-run index command provides following benefits:
- out-of-band reindexing - oak-run reindexing can be done separately from a running AEM setup and thus, it minimizes the impact on the AEM instance that is in use;
- out-of-lane reindexing - The reindexing takes place without impacting indexing indexing operations. This means that the async indexer can continue to index other indexes;
- Simplified reindex for DocumentNodeStore installations - For DocumentNodeStore installations, reindexing can be done with a single command which ensures that reindexing is done in the most optimal way;
- Supports updating index definitions and introducing new index definitions