Zoovu Search Plugin JavaScript API
The Zoovu Search Plugin provides a set of JavaScript methods that allow you to:
- Trigger specific actions outside the plugin.
- Dynamically update configuration settings.
- Control search behavior programmatically.
Configuration
The changeConfig method updates a configuration setting after the plugin has been initialized.
Parameters
key(String) – The path to the setting inzoovuSearchConfig. Example:suggestions.showvalue(*) – The new value to be set.
Examples:
- Update the included result groups:
ZOOVU_SEARCH.changeConfig('contentGroups.include', ['Recipes']);
- Update the entire
contentGroupsobject:
ZOOVU_SEARCH.changeConfig('contentGroups', { include: ['Recipes'], exclude: undefined });
Update siteId
The setSiteId method updates the site ID after initialization.
Parameter:
- siteId (String) – The new site ID.
Example:
ZOOVU_SEARCH.setSiteId('mySiteId.com');
Change base URL
The setBaseUrl method updates the URL used to load search results.
Parameter:
baseUrl(String) – The new search results URL.
Example:
ZOOVU_SEARCH.setBaseUrl('https://api.search-studio.zoovu.com/sites');