I got this error:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (head.js.map, line 0)
as well as these:
Uncaught ReferenceError: algoliasearch is not defined at HTMLDocument.<anonymous> ((index):94) at i (a9b476399a1ace75e81cb940be005dd2.js:2) at Object.fireWith [as resolveWith] (a9b476399a1ace75e81cb940be005dd2.js:2) at Function.ready (a9b476399a1ace75e81cb940be005dd2.js:2) at HTMLDocument.K (a9b476399a1ace75e81cb940be005dd2.js:2) (anonymous) @ (index):94 i @ a9b476399a1ace75e81cb940be005dd2.js:2 fireWith @ a9b476399a1ace75e81cb940be005dd2.js:2 ready @ a9b476399a1ace75e81cb940be005dd2.js:2 K @ a9b476399a1ace75e81cb940be005dd2.js:2
SyntaxError: expected expression, got '<'
ReferenceError: algoliaAutocomplete is not defined[Learn More] wpvilla.in:131:9
The latter two were the real culprit as a soon as these showed up the site would not load properly anymore. The files causing the issue seemed to be:
But I could no longer find a way to exclude these to make the error go away. Only CSS files could be excluded with the latest WP Rocket version it seemed:
So we have turned off minification of JS for now until we have found a solution to the problem. Either an exclusion somehow or Algolia JS Fix. We will keep you posted!
Solution given by WP Rocket for the site not loading with Algolia JS minified in the end was to add this to exclude all Algolia JS:
So that means we probably somehow missed a script besides the ones I mentioned and this one was not excluded. It is now. Happy to have this work though! Again I would prefer to go without the inline script added by Algolia, but to solve that more time would be needed.
Let’s face it, WordPress built-in search kind of blows. You can improve search and boost sales with Algolia Search. It will upgrade search to site wide search including products and offers suggestions! And it really easy to get going.
Improving WordPress Search
Visitors as we know can be an impatient bunch. So if we allow them to find what they need faster they are more likely to buy. Also, if search provides suggestions on what is available he or she might also go to a product though he was searching for blog content he saw earlier.
Unfortunately WordPress search out of the box sucks. Even a plugin like Better Search does not quite cut it. Sure it searches not just post, but other post types as well such as pages, but still it does not suggest other possible content, nor is it really fast.
Algolia Search to the rescue
Lighting fast search with search suggestions Google style can now all be done with the power of Algolia Search. Algolia Search is used heavily in the Laravel community and at Laracasts.com and with good reason.
It is simply an amazing search integration. This is what is has on offer:
content suggestions while typing
suggests other options when the customer misspells something*
*Here example of misspelling where correct search term is suggested:
And while you could integrate Google Search this is way prettier as in really integrates well. Just test it on our site. On typing suggestions popup in a dropdown from where a customer can click on a link. Each suggestion is also displayed with a small thumbnail based on the featured image.
Better Conversion and Lower Bounce Rate
All these features will prove that you can boost sales with Algolia Search. It will suggest possible products to buy and it will show these directly while searching. That is pretty amazing isn’t it. Besides a sales boost it is also just a general retention boost. It will lower your bounce rate as visitors will with ease be able to find follow up content, products and services to look at.
Let me just quote what they mentioned on the plugin description page here:
Algolia offers its Search as a Service provider on a incremental payment program, including a free Community Plan which includes 10,000 records & 100,000 indexing operations per month. Beyond that, plans start at $35/month.
So you can stay on the free community plan post registration – needed for key – as long as you do not pass 10,000 records & 10,000 indexing operations per month. Indexing wise you should not have issues with that anytime soon on most sites and neither should you record wise.
We have had 2,452 records and 3,311 indexing operations so far with with 150+ post and close to 30 pages. Also during the trial the sky’s the limit really.
First of all you need to install their plugin. That is easy as always.
Next you will need to register to get your
search-only api key and
admin api key
and get your trial up and running. The plugin will guide you with this.
Then you need to choose the content you would like to be part of the searches and allow Algolia to index it under autocomplete and activate this. This will take some time as in will need to index and store it at Algolia for lightning fast future searches and suggestions.
Search Page Choice
On Search page you can choose to use WordPress Search Page or the Algolia Search page:
This really depends on your preference. We are testing with at the moment.
Once you are setup you can keep track of indexing, searches done and much much more in their Dashboard.
I like the design and UI in general. It is easy to see what is going on. Do think I won’t be needing to check things here that much, but it is nice to have when search starts getting used a lot.
Rolling your Own
If you want to run it all for free and under your control you can clone the repo and roll your own on your own server. Just to to the repository at Github and get your own copy. Then install in on the same web server or a separate on, and integrate it with your site. Doing this all by yourself will require more technical knowhow and more server power of course, but you do keep all the data under your control