Support » Plugin: Relevanssi - A Better Search » zero hits

  • Hello!

    I have a problem with a search.

    How to search for S.W.A.T. so that it is recognized.
    Currently there are zero hits in the search

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

    (@msaari)

    Relevanssi sees “s.w.a.t.” as “s w a t”, and then just discards it.

    One way to fix this is to add this to your theme functions.php:

    add_filter( 'relevanssi_remove_punctuation', 'swat_fix', 8 );
    function swat_fix( $a ) {
        $a = str_replace( 's.w.a.t.', 'swat', $a );
        return $a;
    }
    Thread Starter movieclass

    (@movieclass)

    I added it to the child theme functions.php, but it is still not found. Maybe the post is not indexed?

    The Link is https://xx/2020/12/30/s-w-a-t-2017/

    Title “S.W.A.T. (2017–)”

    • This reply was modified 1 year, 5 months ago by movieclass.
    Thread Starter movieclass

    (@movieclass)

    I’ve checked the debug version.
    I’m getting as result: Post title

    2017

    Plugin Author Mikko Saari

    (@msaari)

    Try save the post. Does that help?

    Thread Starter movieclass

    (@movieclass)

    i’m saved it, no change.

    I’m also tried to Rewrite & Republish it, no change.

    indexing/Post Title doesnt change

    Thread Starter movieclass

    (@movieclass)

    i disabled the plugin and tried to search with the default search..
    it works perfectly.

    Plugin Author Mikko Saari

    (@msaari)

    Change the function to this and then save the post:

    add_filter( 'relevanssi_remove_punctuation', 'swat_fix', 8 );
    function swat_fix( $a ) {
        $a = str_ireplace( 's.w.a.t.', 'swat', $a );
        return $a;
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘zero hits’ is closed to new replies.