Support » Plugin: Relevanssi - A Better Search » Special searchs

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

    (@msaari)

    By default, Relevanssi replaces the hyphen in your search term with a space, leaving you with “k on”, which probably doesn’t find anything.

    Try adding this to your theme functions.php, indexing the database again and then searching:

    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;
    }
    AliMH

    (@alimh)

    thank you, workin like charm

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Special searchs’ is closed to new replies.