adding search index function