• Resolved engineroom

    (@engineroom)


    Hi there,

    Thanks for a great plugin.

    We have a problem that the below search query will return the product:

    https://www.rexs-speedshop.com/shop/?s=SMU6083-1-1

    However the below doesn’t:

    https://www.rexs-speedshop.com/shop/?s=SMU608311

    I have done the following:

    – Set “Hyphens and dashes” to “Remove”
    – Rebuild the index (several times)
    – Cleared the caches on the site
    – Checked that Relevanssi is being used for the search by enabling logging and checking there is a record of my searches

    Any ideas would be amazing.

    Thank you.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Can you check the database? See the wp_relevanssi database table and search for doc 6071. How does the SKU appear there?

    Thread Starter engineroom

    (@engineroom)

    The term column is stored as “smu6083-1-1” and “smu6083”.

    Here is a screenshot – https://prnt.sc/pt54pu

    Any ideas ??

    • This reply was modified 5 years ago by engineroom.
    Thread Starter engineroom

    (@engineroom)

    There are in 181 entries under the doc 6071. Is this normal?

    • This reply was modified 5 years ago by engineroom.
    Plugin Author Mikko Saari

    (@msaari)

    Yes, 181 entries sounds ok. Looks like the “Hyphens and dashes” setting is not working, since the hyphens are not being removed. Do you have anything in your functions.php that affects this? Any old functions added to keep the hyphens intact? Something is overriding the setting and that’s the most common explanation.

    Thread Starter engineroom

    (@engineroom)

    Ah, thank you so much. Sorted it. I had the below functions in place to try and get round the issue:

    
    /**
     * Relavanssi update to ensure dashes are included in the searches 
     */
    
    add_filter('relevanssi_remove_punctuation', 'savedashes_1', 9);
    function savedashes_1($a) {
        $a = str_replace('‐', 'DASH', $a);
        $a = str_replace('-', 'DASH', $a);
        return $a;
    }
     
    add_filter('relevanssi_remove_punctuation', 'savedashes_2', 11);
    function savedashes_2($a) {
        $a = str_replace('DASH', '-', $a);
        return $a;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dashes in SKU’ is closed to new replies.