Corrected order of search-index rebuild