In this article we will see how to increase the search suggestions in expertrec custom search engine. This can be established with the help of a pre hook script in your control panel .
What is a pre-hook script ?
A pre-script hook is a piece of code that runs before the search is loaded.
With the help of a pre hook script we can tell the search engine to load any number of specified search results in the suggestions.
To increase the number of search results follow the below steps.
- Go to https://cse.expertrec.com/?platform=cse and make sure you have created your search engine.
- Go to script hooks-> prescript hooks and enter the following piece of code.
- You can replace the number 10 to the number of results you want in the suggestions.
_er_config.append_to_response.suggestion_size = 10;
- Now reload your search page and you will be able to see 10 results in the autocomplete.