Can't get search to pull from woocommerce short description

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Can't get search to pull from woocommerce short description

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16052
    dameronc8587
    dameronc8587
    Participant

    I am having an issue trying to get the Ajax Search Pro to search woocommerce Short Descriptions. A long story short, I have alternate part numbers listed in the Short Description fields in Woocommerce and I leave the alternate numbers out of the main product description because it can be confusing.

    The website I am working on is BAXTER CYCLE

    When you search the part number 67-0395 (Alternate number for 67-0741) nothing comes up in the search. If you search 67-0741, the product does come up in the search. You can see the 67-0395 is listed in the product short description.

    I have been messing around with the search settings and cant seem to get it figured out. I was doing some searching on google and the knowledge base and saw a setting “FULLTEXT SEARCH OPTION” But I cant find this setting anywhere in the Ajax Search Pro Admin settings. I am wondering if this is an older setting from a previous version of the plugin?

    I am a bit confused on what else to check to make the search pull products that match a part number listed in the Short Description.
    Thanks for your time. Please let me know if you have any questions or need any information from me.
    Chris Baxter Dameron

    #16064
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Chris,

    I have looked at the description of the products, and I believe I know why the plugin is not able to return matches for those inputs.
    The part number in the description is stored as a single word, but preceeded and followed by a star ‘*’ character. I believe you are using the index table engine, which tries to recognize individual words, then stor them in the database. Unfortunatly the * character does not act as a word boundary, so the index stores it as-is. In your case, the indexed part number is not ’67-0395′ but ‘*67-0395*’ as found within the description. If you do a search query for *67-0395 or 67-0395* or *67-0395* it will find the part – as it matches the word ending, beginning and as a whole in each case.

    The quickest resolution in my opinion is to use this custom filter function I made to remove the star ‘*’ characters before indexing, then re-build the index.
    1. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    2. Then re-build the index: https://i.imgur.com/CXZbB9z.png

    After that, it should start returning the parts by the alternative numbers.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #16073
    dameronc8587
    dameronc8587
    Participant

    Hello Ernest,
    Thanks for your time looking into this issue. You are awesome. That solved the problem. It is pulling up all the parts that are listed as alt numbers now. Perfect!
    I really cant thank you enough for your time.
    Have a great new year!
    thanks again,
    Chris Baxter Dameron

    #16082
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.