Add view hook to search#index (#2250)