Fix Js error on AlgoliaSearch

The error : Uncaught TypeError: Cannot read property 'method' of undefined