Google discontinued its Site Search as a Service from April 1, 2017. For one of our clients who was using Google CSE, the team decided to implement the Sajari search which is a high-performance custom search for enterprises.
There is a contributed module already available to use Sajari on Drupal websites. But we know that each additional contributed module adds overhead to Drupal, impacting the performance.
In our case, the client was very keen to have minimal impact on performance. So, we decided to build a lightweight custom module for Sajari integration ensuring appropriate custom search matches.
Sajari team gave us the javascript code snippet for the functionality. They also provided the unique key for our website. Based on our research and the documentation provided, we completed the implementation in the following steps.
- Created the search box using the html and added the class that was mentioned by sajari
- Our objective was to display the result in a specific page. For this, we added a routing page url in the javascript.
- Now the target URL will accept the query parameter and will display the result on the page.
- Sajari provides the option to display results in categorized tabs. This would enable these tabs.
Note: When we moved our site from http to https, only data from http sites was being displayed. So, again we re-crawled the sajari search. Kudos to Sajari team, we have not seen any downtime so far. We were able to display the content in https too.
Feel free to Contact Us for your Enterprises