Cannot get Algolia to replace the WP search in WooCommerce

I’m at a loss. API key and all these settings are, sync’d, yet I cannot seem to get your plugin to work. Not sure what I am doing wrong. Any help is greatly appreciated. We waited a while to get this plugin launch and now I can’t get it to run. My client is also really excited about getting his store back up with a better search experience!

Thanks,

Paul

Hey @paul1,

I’d gladly help you out getting the search up and running,

Could you give me a bit more information regarding what goes wrong?

Did you try following the getting started here ?:https://community.algolia.com/woocommerce/quick-start.html

If so, can you tell me where it goes wrong? Does it index? do you have errors on the logs page? in the php logs?

Looking forward to help you out,

I guess all my emails didn’t come through to here (I should have read the Visit Topic to respond!)

Hello Ray,

Ok so everything is indexed. Now I am having a hard time with ‘‘Choose where to inject your search inside of the pages’’. I selected the WooCommerce search on the sidebar and it was still using the regular search engine.

In the search page settings, I have instantsearch.js selected. Is it the right one? I also have a few questions…

What happens if we don’t use the sidebar search? Where else can we find the WooCommerce Search or where else can we use yours?

Is there a shortcode that we can use?

We also use the WC Product Search plugin which allows us to use a shortcode and place the search engine on any page, which is how my client’s website is setup. Are they compatible?

Best regards,

Paul

Hi Ray,

I checked one of the category pages and found the search engine (non functional). I can type, but there is no search button, and nothing happens when I press enter. There’s also a Filter By right under the search bar. When I click it I get a blank screen that pops up. Both screenshots are attached.

I setup the WC search on a sidebar and setup a blank page so I can test it, but that wasn,t replaced by your search engine.

<img

Best regards,

I see 2 problems @paul1

You should use the following CSS selector on Algolia Search -> WooCommerce -> Zoning: .mk-main-wrapper-holder

That way to search will effectively replace the right side of the page. http://tonergenerique.ca/?s=&post_type=product
Currently it only occupies a small column.

Then you definitely have some indexing problems which we need to troubleshoot. Please send us the error details on Algolia Search -> Logs and also the PHP error logs if you have access to them.

Best,

I changed the CSS selector, but it is still using the default search. For the indexing problem, below is the Algolia Search error log (VERY long) and followed by the pho error log. Actually the Algolia error log for one entry is so long your system won<t accept it… Will be sending in multiple messages

Thanks,

Paul

AlgoliaSearchAlgoliaException Object
(
    [message:protected] => Index wp_searchable_posts does not exist
...

@paul1 I removed most of the logs and left the interesting part.
What we see in your last log is that the index doesn’t exist. Which probably means the indexing didn’t manage to complete. Problem is that this error is probably linked to a search in the backend. Can you confirm you use the “search in backend feature”?

Anyway, this doesn’t tell us why the indexing fails.

Could you use the following extension: https://wordpress.org/plugins/error-log-monitor/
Relaunch the indexing and head to the dashboard of your wordpress to see the PHP errors?

Hello @rayrutjes OK so I restarted everything again with the client’s account this time, indexed and it works.

Can you please take a look at why it is taking a long time to load? For example, when I go to http://tonergenerique.ca/testing/ and do a search, it takes about 10-15 seconds to give me the search result page. Once I’m on the search result page, and I use the search engine there, everything is almost instantaneous.

Also, is there a shortcode that allows us to put the search bar anywhere we want?

And is there any way we can change the filters that appear on the left sidebar on the search results page?

THanks for getting back to me.

Best regards,

Paul

Oh and one more thing. Translation. Will it be translation ready? WPML?

Best regards,

Paul

Hi @paul1

I just took a look at the website, and the initial loading time is of about 10s indeed.
This is mainly because of the numerous CSS and JS files that are loading.
You should probably use a plugin to minify all of that in a single file for CSS and another for JS.

Once the page has loaded, the Algolia instantsearch.js takes it over and directly communicates with the API to provide very fast answers without requiring any additional roundtrips to your server.

For now we have no shortcode to inject the search at other places, but definitely something we are thinking of.

To add / remove attributes from the filters, I’ll add a guide to the documentation pretty soon and let you know.

We are not WPML ready yet, but are working on making sure all strings are translatable.

Hello Ray,

All pages load very fast on the website. Except for the initial search results page. In any case, In any case, both the theme js and css files have been minified, but still having the same issue. The problem is with the initial search.

So as of right now the only place we can launch the search is from a sidebar?

In regards to the filters, will this require coding? Or checkboxes :slight_smile:?

Or maybe also a way to expand them?

Thank you for all your hard work man! My client can live with most of the things now, just not the 10-15 seconds. This is why we signed up with you guys. Because of that speed. :-/

Hope we can figure what is causing this delay.

Best regards,

Paul

@paul1

From the dev tools I can see that the backend of the website takes nearly 10s to return the content:

Could you disable the Algolia plugin for WooCommerce to see if the page is still as slow to display?
If yes, could you also try disabling the Algolia plugin for WordPress?

I disabling one of the 2 plugins resolves the speed problem, I’ll need to investigate further to know what is causing the slow loading.

Regarding attributes, we updated the documentation to include a link to a plugin that will help you customize the attributes you want to display: https://community.algolia.com/woocommerce/customize.html

You will need to install it and uncomment the block starting here: https://github.com/algolia/algoliasearch-woocommerce-custom/blob/master/algoliasearch-woocommerce-custom.php#L21

Feel free to also explore the other options.

Finally, what do you mean by “expand them”?

With both Algolia plugins deactivated, it takes the same amount of time. 10-15 seconds. This is why we signed up for your service. And it seems your plugin is working on the search results page, but on the main search, it seems like it is still using the default search. Is that possible?

Can you take a look at my logs in the Algolia Dashboard? Everytime I search from the testing page, There is a 404 error that appears.

OK @paul1 I better understand your use case :wink:

Can you try turning on “Use Algolia in the backend” on “Algolia Search -> Search Page” ?
This should alter the default query to make it point to Algolia instead of to your database. You’ll still have a very simple database query only matching IDS, so you should see the difference.

Let me know if that works. If it doesn’t, then you should find a way to hook into the backend search query and remove all the filtering going on there.

My bad Ray. There was a search plugin I forgot to deactivate (Search Everything). It works fine now! Really nice! Client is happy! I will be looking at how to play with the attributes and other stuff. Might pop in here for more questions or suggestions if you don’t mind?

Best regards,

Paul

2 Likes

That is great to hear @paul1, I’m glad it works now.

Please do open new topics if you have any other question,

Cheers,