Skip Navigation

[Resolved] Parametric search does not find results and autocomplete stop working

This thread is resolved. Here is a description of the problem and solution.

Problem:
Parametric search failing to find products imported via WP All Import.

Solution:
Examining how the product names are stored in the database revealed that WP All Import was inserting extra spaces in the product names which meant the searches for them did not match.

The crucial test that revealed the problem was whether the searches worked directly in the database using LIKE %%, which they did not.

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 13 replies, has 2 voices.

Last updated by Pagel 7 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#401109

Hello again,

Another question about parametric search.

The search does not find any results when my product name is over 30 (or something close there) characters. I use my search combined with Relevanssi and Search Autocomplete. I have tried without them and the issue remains. If I use autocomplete and click products with more than 30 characters it will show No items found. So any way to raise the limit?

As far as I know there isn't autocomplete with Views so therefore I am using Search Autocomplete but I am facing issues after first search because after that the autocomplete is not working at all. I am using Ajax: Update the View results every time an input changes. What could make this happen?

BR
Pagel

#401236

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

cKdATaodhZ.gif

I tried to replicate the problem using a basic install with only the required plugins and the WooCommerce Storefront theme.

I made a few products with names of varying lengths, and then created a parametric search View to display the products, and, finally, inserted this view onto a page for display.

I didn't experience any problems with the length of the product names when searching, as you can see in the attached screen recording.

I expect the problem you are having is with your autocomplete plugins, or is something to do with your theme or other plugins.

As is normal in these circumstances you should try switching to a default theme (such as twentysixteen or storefront) and disable your plugins except for Toolset and WooCommerce to see if you can isolate the problem.

#401579

Hi Nigel,

I tried all those thing you suggested but the issue remains. I was not able to isolate the problem.

Any idea for that autosuggestive issue?

BR
Pagel

#401589

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Pagel

Sorry, but can you clarify, if you disable your autocomplete plugins you don't have the problem?

So you are looking for an autocomplete plugin that works without creating the character limit problem, is that correct?

#401787

Hi,

At the moment I am using Parametric search + SearchAutocomplete + Relevanssi together. The character limit problem remains even when I deactivate SearchAutocomplete and Relevanssi.

So the issue is not with those plugins.

Ultimately that's the outcome I am looking for 🙂

I have not found yet a better autocomplete solution that work with parametric search than SearchAutocomplete + Relevanssi as there is not an autocompelete feature in parametric search yet, am I right?

Of course I am open to new solutions but at the moment the issues are that search is limited by characters (with or without other plugins) and the autocomplete stops working after the first search or when I change any filter value.

BR
Pagel

#401798

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

If you are experiencing a 30 character limit on parametric searches even when you have disabled other plugins and switched to a default theme (the scenario I tested) then it is premature to talk of which autocomplete plugin to use alongside Views.

We need to make sure your search is working correctly first.

I'm going to need a copy of your site so I can do some testing.

Could you please use one of the following two free plugins to create a snapshot of your site and upload it to a public url (such as dropbox or google drive) so that I can reproduce a copy of your site locally to test.

* Duplicator. You will need to create and upload both the installer and archive packages as shown in the demo video on their plugin page: https://wordpress.org/plugins/duplicator/

* All-in-One WP Migration. This is simple to use and is less prone to fail because of server settings than Duplicator. https://wordpress.org/plugins/all-in-one-wp-migration/

I will mark your next reply as private so that you can give me the url to retrieve the backup files.

Thanks for your patience.

#401856

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Pagel

Sorry for the inconvenience, I should have said, if you are using All-in-One WP Migration the maximum file size of the archive I can accept is 512Mb.

Before creating the archive you can specify excluding media, which I won't need for testing this issue and which should bring down the size of your archive.

I've marked your next reply as private if we could try again.

Thanks

#401880

Hi Nigel,

I guess I figured out the issue, not that I solved it yet. I am using WP All Import to import multiple products. The search issue was in those products. Those products look fine in admin side and in the parametric search page. I am able to find those products if I search say 25 characters but if I copy the product name and search that then it will find nothing. Quick editing those in the WC product tab does nothing but if I edit product individually and update. Then I can find those with searching by product name. Well updating products one by one when we have import of 200 products are not ideal. Not sure what is the root issue. Maybe you have some ideas?

BR
Pagel

#401891

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Pagel

I set up a copy of your site for testing.

I disabled all non-essential plugins (basically everything except Toolset and WooCommerce).

I noticed there were errors from you custom JS on the Product search View so I removed it. (Possibly related to the fact that I have no media attachments in my test site.)

I created 2 products, "I have a very long product name indeed" and "I have a very long product name indeed even longer than the other", both with product names in excess of 30 chars.

I visited the page View: Product search to test.

At first this page returns all products. I introduced the search term "I have a" and the page updates to display both products. I tried the search term "I have a very long product name indeed" which returned both products, as expected. And, finally, I tried the search term "I have a very long product name indeed even longer", which narrowed it down to just the one result, again, as expected.

Can you please perform the same test on your end, disabling all plugins except Toolset and WooCommerce, to verify the same.

Can you then do some more testing to identify what long search terms don't work as expected and then report back to me so that I can try and reproduce it here?

Thanks

#401897

Hi Nigel,

there were no issues in those. As I wrote earlier the issue is linked to WP All Import products. Please see reply below. For example in my case this product name is not searchable: "HXUR 565 G2 B3 | 110 KW 156A 500 V 1500 RPM B3 280M75"

Until I update is via WC product tab after that it's all fine but for some reasons I cannot find those products eventhough they look fine.

BR
Pagel

#401903

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Pagel

I looked in the wp_posts table in the database to check if there was anything anomalous with how the title is stored. (FYI I used the adminer plugin to browse and search the db)

So, I found this product in your WP backend:
post title: HXUR 405 G2 B3 | 30 KW 45A 500 V 1500 RPM B3 200M55
post id: 557

So, I should be able to search the post_title using LIKE%% and find your product, but it returned nothing. Now if I use the post_id to look at the product entry I can see that it has lots of additional spaces compared to how it appears on the back end.

Compare what's in the database with how it appears on the front end:

HXUR 405 G2 B3 | 30 KW 45A 500 V 1500 RPM B3 200M55
HXUR 405 G2 B3   |   30 KW  45A  500 V  1500 RPM  B3  200M55

That's your problem. I don't mean to pass the buck but I think you need to get in touch with WP All Import to find out why.

Good luck!

#401905

Hi Nigel,

Thanks you for checking that. I will talk further with WP All Import.

Now that this is figured out. Could you help me with the autosuggest issue?

BR
Pagel

#401910

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Pagel

Toolset doesn't have native autocomplete and setting up autocomplete requires custom coding we can't offer support for, I'm afraid.

The search autocomplete plugin you are using adds the jQuery UI Autocomplete functionality, but you have to instantiate it, populate it with your search terms and hook it on to your search form, and you will need to write the code to do that (or contract a developer to do it for you).

WordPress already includes an auto-complete library called suggest.js which you could use, but it still requires the same steps as above. See here for docs: hidden link

#401917

Hi Nigel,

Yes, I figured it out that there would not be a simple plugin for autosuggest.

That plugin SearchAutocomplete is working great but it does not work after first search or after changing filter values. You need to refresh the page in order to get it work again.

Thanks for the help again and I will consider my options how to get autosuggest working on my site.

BR
Pagel

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.