add search functionality to index.