write a function for .searchInd