Added count method for index and search query