add in code for index_add (write side add index record),
and also handle index_sync() as well, since index_add needs it too.