SearchServive and search.js fix.
Refactoring.