refactored patched search#index action
fixed pagination