Here are some applications of this Script-Hooks scripts feature-
- Increase the number of suggestions (or) drop-down results in the search autocomplete UI
- Disable search listing pages.
- Increase the number of search results on a page.
- Disabling the search results page and more.
Here is an application – Increase the number of search results in search autocomplete.
Here we will take an example of how to increase the number of suggestions in the search drop-down using the PRE-INIT script. By default, there are 5 results in the autocomplete.
- Go to https://cse.expertrec.com/?platform=cse and create your search engine.
- Go to Script-Hooks > PRE-INIT and enter the following piece of code.
- You can replace the number 10 with 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.
For more information about running custom scripts along with Expertrec Search, please contact the technical support team here.