Hi,
Thank you for the details, it helps a lot!
The most likely cause of the issue is, that you have exact matches turned ON. Exact matching requires the phrase to be in the text as is written into a single field, in that exact same order. However that is very unlikely in this case for “2009 Hyundai Accent“.
I suspect the model year, make and model are stored in different custom fields. Turning OFF the exact matches should resolve the issue.
All the best,
Ernest
Hi Ernest,
I tried turning off Exact Match and have managed to get the search function to work but it’s still only allowing two words to be searchable when I type any third character or word it queries “no results” even though I have the exact data stored as ACF fields.
Check if the desired fields are selected, any number of words should work, there is not limit to it.
I tried a few different ones, from what I can see I suspect the model year and other fields may not be selected in the custom fields to search for. This result comes up for a 3 word search “hyundai accent 2012”, because the title contains the year as well.
All the best,
Ernest
I have the option checked to “search all custom fields.”
Also go ahead and try “2012 Hyundai Accent”
It will return “no results”
People search by year, make and model in that order. Not reverse as you’ve shared.
What type of fileds are the model/make/year in ACF? If those are part of repeater/object/post type reference or similar fields, then the model/make/year is not actually stored in the field but only the reference to it and only the ID is stored – and it that case it’s unfortuntely not searchable.
All the best,
Ernest
They are all 3 standard ACF text fields
In that case it should work just fine.
Can you try selecting them individually from the list instead of “search all fields”? Maybe there is an issue with that, I will have to check the source code later.
All the best,
Ernest
I just unchecked all custom fields option and cleared browser cache and checked and it’s still doing the same thing only searching the 3 word phrases with year, make model typed in that order returns “no results”
Do the custom fields added need to be the ones with the underscore or without in settings? _year instead of just year?? I see the underscore versions in the selectable list in settings, I wasn’t sure if those needed to be used instead???
Add both versions just to make sure.
This may be a bit hard to figure out this way. Can you please go the Help & Support submenu under the Ajax Search Lite menu, there you will see some debug information, which you can share with me via either a github gist or paste.ee link. Please do not copy & pase it in here directly, it’s a very long string.
With that I will be able to see some parts of the query as well as the configuration, maybe that helps.
All the best,
Ernest
Done, and it’s still doing the same thing. This time I tried “1998 Jeep Wrangler” and still get no results even though there is a post with the data present in the database. Here’s the Paste.ee link with Debug code: https://paste.ee/p/xpnP2
Thank you!
Okay, I see nothing strange in it, the field contents are all right as well, so this is going to be a bug for sure. I tried to quickly replicate something similar on our local setup, but for some reason that is all right, so I don’t quite understand what exactly is happening here yet.
I will try to import the setup tomorrow when I get back at the office with your configuration. Maybe that will reveal the issue. It is now more then likely a code related bug. Let’s hope it’s not specific for your exact wordpress setup.
I will get back to you tomorrow once I did the tests.
All the best,
Ernest
Thanks Ernest! I look forward to learning more tomorrow. I appreciate your attention to this matter. Maybe I found something to help everyone else!
I am back with good news!
I have found a potential issue with the query, however the only way to fix it is by replacing file contents in the plugin folder with the fixed one.
This is not yet final, but it seems to be a very promising fix. Before you start replacing anything, please have a full website back-up just in case – so you can restore if anything goes wrong.
Once you have a backup and everything is ready, please try the following:
- Open up the wp-content\plugins\ajax-search-lite\includes\classes\search\class-asl-search-cpt.php file on the server
- Replace it’s content with this
- Save
I strongly recommend doing this via (s)FTP, it is more secure to restoration.
Once the content is replaced you should very likely start seeing the correct results. Please let me know and I will mark this as a potential fix and include it in the upcoming release.
All the best,
Ernest