Issue 249 - Bug - Rewrite the search.js

Refer to #249