• Resolved kamran1331

    (@kamran1331)


    Hello,

    i have Titel: F.O.X Art-paint Vitrage Red

    but in index Relevanssi see only this: art-paint red vitrage

    How i can change configuration that it will be like this: fox art-paint red vitrage

    Thanks.

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

    (@msaari)

    The problem is the periods: they are replaced with spaces. If this word appears only in this post, the easiest solution is to make sure the word “fox” appears somewhere in the post – it can even be a user-invisible custom field – but if these words are common, it’s possible to add a filter that fixes this.

    Thread Starter kamran1331

    (@kamran1331)

    yes that is Brand name F.O.X and we have many product wir this name, how I can add a filter to fix this? Thx.

    Plugin Author Mikko Saari

    (@msaari)

    add_filter( 'relevanssi_remove_punctuation', function( $str ) {
    return str_replace( 'f.o.x', 'fox', $str );
    }, 9 );

    Add this to a code snippet or in the theme functions.php and reindex.

    Thread Starter kamran1331

    (@kamran1331)

    thanks, is going.

    • This reply was modified 1 year, 4 months ago by kamran1331.
    Thread Starter kamran1331

    (@kamran1331)

    Sorry i wroute that is workking, but the “F.O.X” in the tittle dont see in Index, only if this name is in text or slug, but not in tittle.

    Plugin Author Mikko Saari

    (@msaari)

    Try this:

    add_filter( 'relevanssi_post_title_before_tokenize', function( $title ) {
    return str_ireplace( 'f.o.x', 'fox', $title );
    } );

    Again, add this and reindex.

    Thread Starter kamran1331

    (@kamran1331)

    work. thx.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘add this word in index: f.o.x’ is closed to new replies.