Forum

Please or Register to create posts and topics.

Re-Index from within Python script?

I'm using a Python script with the SQLite interface and Unifuzz to create new citations and, especially, new CitationNames. After updating the RM9 database with a batch of them, I let RootsMagic 9 do the re-indexing. Can I safely do the re-index from within my script?

Arguably, you should REINDEX in SQLite before running any queries because your collation sequence is different from the RMInc proprietary RMNOCASE, If you do not, there is some risk of error. An Integrity Check will report some errors even if you have made no changes.

There is no point in reindexing in SQLite on leaving the database to return to RM. The indexes will have been built on the fake RMNOCASE and RM's Integrity Check will report errors therefrom until you have reindexed within RM against its RMNOCASE collation sequence.

One surprising outcome from the RM8/9 development is that a database from the Mac version fails the Integrity Check in Windows and vice-versa indicating that the RMNOCASE collation sequence in one OS is different from the other. Reindexing post-transfer is needed.

Quote from Ken Murphy on 2023-12-08, 9:16 am

I'm using a Python script with the SQLite interface and Unifuzz to create new citations and, especially, new CitationNames.

Feel free to share your script in this platform, Ken. It may be useful and inspirational to others to see what it does and how it's done.