If you have a completely custom index, you are responsible for updating the index records. I hope you don’t just rebuild the entire index all the time, because that would be torturing the CPU for no reason
The data for the indexes are ValueSets that are built with a ValueSetBuilder. When some action is performed or when some notification is triggered you can update single record by creating a ValueSet and only update that value set to the indexby calling Index.IndexItems(valueSets);