Creating the index and retriving results