apply ajax to first page and direct search link of navbar to index action of search