The index is wiped/reindexed depending on the -chronikscripthashindex (init param) value, the reindexing process takes about 12 minutes with the current blockchain.
After the initial is sync, new scripts are added to the index via the ScriptGroup index.
This will be needed for the ElectrumX API. Ref T3598
This diff does not deal with mempool data. This needs to be done in a separate diff.