replace search by index