WordPress.org

Support

Support » Plugins and Hacks » Relevanssi - A Better Search » [Resolved] Fuzzy Search Option Not Honored

[Resolved] Fuzzy Search Option Not Honored

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

    @msaari

    Relevanssi sees both “L-1-803” and “L-1-803-HO” as “803”, after punctuation and too short words are removed.

    Looks like you might want to modify the punctuation removal so that it keeps the hyphens.

    add_filter('relevanssi_remove_punctuation', 'fixhyphens1', 9);
    function fixhyphens1($a) {
       $a = str_replace('-', 'HYPHENHYPHEN', $a);
       return $a;
    }
    
    add_filter('relevanssi_remove_punctuation', 'fixhyphens2', 11);
    function fixhyphens2($a) {
       $a = str_replace('HYPHENHYPHEN', '-', $a);
       return $a;
    }

    Add this to your functions.php and reindex the database, and it’ll work better.

    Thanks so much Mikko, that worked perfectly! I appreciate the response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Fuzzy Search Option Not Honored’ is closed to new replies.
Skip to toolbar