• Resolved solventweb

    (@solventweb)


    Hello. Firstly, thanks for a great plugin! My client reported an issue where one of their WooCommerce products was not showing up as expected in search results. The product title in question is “D3 125 mcg” When I used the debugging tab in your plugin I saw that the post title was interpreted as “000 125 mcg”

    So I created the following synonym: “D3 = 000” That kinda works, but it returns some irrelevant results because of the partial word matching (e.g. for products containing the word “1000”). Any ideas on a better solution?

    Thanks!

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

    (@msaari)

    I have no idea what converts “D3” to “000” – nothing in Relevanssi certainly should do that. The minimum word length in Relevanssi is 3, so the title should be indexed as “125 mcg”. I would recommend setting the minimum word length in the advanced indexing setting to 2 and then reindexing, that should make Relevanssi index the title as “d3 125 mcg”.

    Thread Starter solventweb

    (@solventweb)

    Thanks for your help! Changing the minimum word length fixed the issue… I was wrong about the “000” replacement. It just came from “1,000” in the title ??

    Plugin Author Mikko Saari

    (@msaari)

    If you have commas inside numbers like that, you may also want to add

    add_filter( 'relevanssi_remove_punctuation', 'keep_decimal_separators_1', 9 );
    function keep_decimal_separators_1( $a ) {
        $a = preg_replace( '/\,(\d)/', '\1', $a );
        return $a;
    }

    Once you add this and reindex, all commas that preceed digits are removed, so “1,000” is indexed as “1000” and not as “000”.

    Thread Starter solventweb

    (@solventweb)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post titles containing “D3” converted to “000”’ is closed to new replies.