I think lucene indexer problem can be solved if do not take in consideration others problems. If concentrate only in this problem should take in mind can not be indexed contents if rsync has not been completed, the binary sync should be done before database. Indexer has two stage:
1- When new record is added the metadata of record is indexed and document is marked in database to index contents, columns NDC_TEXT_EXTRACTED indicates that a document is on queue. Across hibernate api, any record changed is automatically indexed by lucene ( folder, document, mail or record ). That's I think the major difficult if you want to go with option 1.
2- Index documents in pending queue (NDC_TEXT_EXTRACTED = 'F')
SELECT * FROM OKM_NODE_DOCUMENT where NDC_TEXT_EXTRACTED = 'F';
1- When new record is added the metadata of record is indexed and document is marked in database to index contents, columns NDC_TEXT_EXTRACTED indicates that a document is on queue. Across hibernate api, any record changed is automatically indexed by lucene ( folder, document, mail or record ). That's I think the major difficult if you want to go with option 1.
2- Index documents in pending queue (NDC_TEXT_EXTRACTED = 'F')
SELECT * FROM OKM_NODE_DOCUMENT where NDC_TEXT_EXTRACTED = 'F';