RAZ-1873: Improvement to search index code