Autocomplete stopped working
-
We have finally activated the plugin and indexed all the data. A few minutes after the indexing is completed, the plugin stops providing results, and although everything appears correct in Algolia, we keep getting ‘No results’ from the autocomplete in the search box. However, the results do show up on the results page. It seems there is an issue with the autocomplete. What can we do?
-
Are there potentially any javascript/console errors going on? Do you have a link where we could see and try things out ourselves?
We have console.log error but caused by adv, not by website directly (so we can’t do anything on that). Check out this link (it’s production website so please tell me when you finished):
https://www.tempi.it/Not quite sure what may be going on, as my browser console is showing results coming in via XHR requests.
Have you done any customizations of the Autocomplete setup, outside of just enabling as a whole?
no customization of any kind, just enabled. Curious fact. As long as Algolia was indexing the data, it worked, but after it finished, it stopped working
Based on what I’m seeing, your Autocomplete configuration is set to use “All Posts”, but it doesn’t explain why you’re getting the no results messaging.

This is the settings. Everything on algolia website works fine (search etc in algolia dashboard). Probably there’s a huge number of posts? (60k)? But why it’s not working at all?
I’ve probably found the issue. This error appears on Algolia despite the logo being present in the autocomplete. Should the logo also be added to the search results?:
The Algolia Build plan is your Search & Discovery playground. It’s not intended for production projects.
If your project is live, you’ll need to display the Algolia Logo next to the search results or upgrade to the Algolia Grow plan.
Now we added logo in search results but nothing changed. can you make a check on your plugin?
The logo display shouldn’t be affecting results at all. I’m not sure what’s going on or why it’s happening because I see results in the XHR requests as I mentioned earlier. Not really anything I can think of to poke at as this would be the Autocomplete library itself, which we don’t manage.
So, what can we do now? We reached out to the Algolia support team, but they told us to contact you.
Hypothesis: Are there any strange characters breaking autocomplete.js?-
This reply was modified 1 year, 7 months ago by
gleenk.
I wish I had a better answer, but at the moment, I’m not sure. Do you have a staging copy of the install that you could try things out on, including reducing down other active plugins as much as able, and perhaps using a default theme? The idea here being eliminate as much possible conflicts could be coming in, and if it starts working again, start turning things back on until the issue is re-introduced.
Are there any strange characters breaking autocomplete.js?
I won’t say no, but I can’t say for certain yes either, without being able to do some trial/error.
I don’t think there are any issues with the theme, it’s a custom theme, made by us, with no particular functionalities. As for the plugins, we can try selectively, but the problem is that, having so many records, the search queries skyrocket and block our license.
Not sure what to suggest beyond that. Getting things to as little variables as possible is the idea.
How many plugins are in play here?
Algolia says there is some technical issue related to the fact that the search queries are so high, even though only a few have actually been made. Are we sure that queries are not being triggered for every character typed? Is it possible to avoid this and trigger the request after a delay, once at least 3 or 4 characters have been typed?
There’s some code examples over at https://github.com/WebDevStudios/wp-search-with-algolia/issues/398
This example below just modifies the autocomplete.php template directly, which you can see more about at https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-the-Autocomplete-dropdown
source: algoliaHitsSource( client.initIndex( config[ 'index_name' ] ), {
hitsPerPage: config[ 'max_suggestions' ],
attributesToSnippet: [
'content:10'
],
highlightPreTag: '__ais-highlight__',
highlightPostTag: '__/ais-highlight__'
} ),
debounce: 2500,
templates: { ... }Something like above would delay execution by 2500ms and this 1 line addition would be for around this spot https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.8.1/templates/autocomplete.php#L109-L117 which I pasted some of above.
We’ll make a try hardcoding it but, can you then provide an option to do that in your plugin options page?
-
This reply was modified 1 year, 7 months ago by
The topic ‘Autocomplete stopped working’ is closed to new replies.