• Resolved janhamer

    (@janhamer)


    due to the problem of synonyms with “and” search: is there any way to search for a the defined value instead the key (not combined) ?

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

    (@msaari)

    Sorry, but I don’t understand the question. Can you please provide an example of what you mean?

    (If you want to use synonyms in the AND search, Relevanssi Premium has the feature.)

    Thread Starter janhamer

    (@janhamer)

    we are using “and” search.

    what we are looking for is a solution that, for example, if the search term “sicilia” is entered, the search will be for “sicily” instead.

    Plugin Author Mikko Saari

    (@msaari)

    Here’s how you can replace words in the search query:

    add_filter( 'relevanssi_search_params', function( $params ) {
      $replacements = array(
        'sicilia' => 'sicily',
      );
      $params['q'] = str_replace(
        array_keys( $replacements ),
        array_values( $replacements ),
        $params['q']
      );
      return $params;
    } );
    Thread Starter janhamer

    (@janhamer)

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘synonymes with “and” search’ is closed to new replies.