You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We're trying to reduce the amount of calls done to Algolia, as we're charged per request, and I'm reading that autocomplete.js has a debounce option but I can't find a filter to apply that configuration. We're attaching the autocomplete function to the default WP search field by not altering the default selector.
Describe the solution you'd like
Something like a filter for altering these options as I'm trying to do here, maybe it's there but I can't find the proper approach
add_filter('algolia_autocomplete_config', 'algolia_autocomplete_config_custom');
function algolia_autocomplete_config_custom($config) {
foreach ($config as &$item) {
$item['debounce'] = 2500;
}
return $config;
}
add_filter('algolia_config', 'algolia_config_custom');
function algolia_config_custom($config) {
$config['debounce'] = 2500;
foreach ($config['indices'] as &$index) {
$index['debounce'] = 2500;
}
return $config;
}
Describe alternatives you've considered
I tried patching my local version of this project but I can't seem to find the place where the autocomplete is initialized.
Additional context
No additional context, just seeking for help as it sounds unrealistic that nobody had endpoint hitting rate issue before.
Thanks everyone
The text was updated successfully, but these errors were encountered:
I know I have my replies over at #380 about the exact same topic.
Your use of the filters would definitely be one way to get something into the configuration variable, but it'd still need to be passed in as part of the code used in autocomplete.php file.
Perhaps right before the templates property around line 117. Based on your code examples above:
debounce: config['debounce'],
Let us know if you need some guidance/pointers on how to best customize the template files safely, we definitely have documentation on that topic as well.
Is your feature request related to a problem? Please describe.
We're trying to reduce the amount of calls done to Algolia, as we're charged per request, and I'm reading that autocomplete.js has a debounce option but I can't find a filter to apply that configuration. We're attaching the autocomplete function to the default WP search field by not altering the default selector.
Describe the solution you'd like
Something like a filter for altering these options as I'm trying to do here, maybe it's there but I can't find the proper approach
Describe alternatives you've considered
I tried patching my local version of this project but I can't seem to find the place where the autocomplete is initialized.
Additional context
No additional context, just seeking for help as it sounds unrealistic that nobody had endpoint hitting rate issue before.
Thanks everyone
The text was updated successfully, but these errors were encountered: