prevent idx-recid from being emptied by indexing

Fixes Mantis issues #810 and #812