Open acividini92 opened 9 months ago
I know I have my replies over at https://github.com/WebDevStudios/wp-search-with-algolia/issues/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.
As per the documentation info at https://github.com/algolia/autocomplete/tree/v0.38.0#datasets, you'd want to set the configured time in milliseconds alongside this code: https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/templates/autocomplete.php#L108-L151
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