• Why won’t the Ajax Search Lite search function allow me to search a 3 word phrase? I’m using ACF custom fields and enabled to search them so that is not the issue.

    Here’s a screenshot of my settings screen below. Notice the “No Results” for a search as simple as “2009 Hyundai Accent” which you can see I have a Vehicle matching that exact spec on the page (first listing) so it should show it in the AJAX Results!!!! But it just refuses to show it.

    Thanks for your help!

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    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.

    Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    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.

    Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    They are all 3 standard ACF text fields

    Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    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???

    Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    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

    Plugin Author wpdreams

    (@wpdreams)

    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

    Thread Starter Why Not Advertising, LLC

    (@whyknott)

    Thanks Ernest! I look forward to learning more tomorrow. I appreciate your attention to this matter. Maybe I found something to help everyone else!

    Plugin Author wpdreams

    (@wpdreams)

    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

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Can’t search by more than 2 words refuses to show results for 3 word phrases’ is closed to new replies.