search with multiple slashes not found eg LT/SB/640/LID

Home Forums Product Support Forums Ajax Search Pro for WordPress Support search with multiple slashes not found eg LT/SB/640/LID

This topic contains 3 replies, has 2 voices, and was last updated by ekuk ekuk 6 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13139
    ekuk
    ekuk
    Participant

    Hi, I need to search products on this site including attributes within variation products and then link to that product. As far as I can tell I have set it up to do this and it works nicely so if i search for the title, something in the description, something in the variation description, or the attributes of variation products it works. However I’m having a glitch with part numbers (one of the variations attributes).

    so on this page: http://www.lawtontools.co.uk/en/product/aluminium-storage-boxes/

    we have part number LT/SB/640/LID

    If you search for LT/SB it finds it so it is indexing that attribute. However if you search for LT/SB/640 or LT/SB/640/LID it doesn’t find it. So it must be searching the part numbers but I’m guessing the /’s are killing it, it can take one / but not two or more. This is causing me a big headache with the customer as their part numbers can contain 3 or 4 /’s

    Can it be fixed so it can read the full part number? eg LT/SB/640/LID

    Attachments:
    You must be logged in to view attached files.
    #13141
    ekuk
    ekuk
    Participant

    looking back at my last ticket when I first built the site I see we had a similar issue and you did a fix:

    function asp_remove_slash_phrase( $phrase ) {
    return ASP_Helpers::clear_phrase( str_replace(“/”, “”, $phrase) );
    }
    add_filter( “asp_search_phrase_after_cleaning”, “asp_remove_slash_phrase”, 1, 1 );

    I’m guessing this only works for the first slash? which is why it works for LT/SB? the code is still in place in my functions.php file. could we have a version that can find more than one / ?

    #13145
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I believe the problem was that it was not actually indexed. Some WooCommerce attributes are still stored as custom fields and not taxonomy terms, and most of them are to be found in the ‘_product_attributes’ field.

    I have changed the index table configuration and added these custom fields to it as well, the re-created the index table: https://i.imgur.com/Uqpipgj.png
    It picked up around additional 4000 keywords, so I believe it has been indexed. I’ve also removed the previous code from the functions.php file, as it’s no longer neccessary for the latest release.

    It should be displaying the products based on the part numbers correctly now.

    Best,
    Ernest Marcinko

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


    #13146
    ekuk
    ekuk
    Participant

    many thanks 🙂

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

You must be logged in to reply to this topic.