• Resolved salvador21

    (@salvador21)


    Great plugin, I will donate or buy the premium

    One question, please excuse me if this is obvious.

    If I search for a word with either singular or plural, I get twice as many hits for the singular. This makes sense, but ow do i make it so plural searches also bring up the singular?

    (I have fuzzy set to always)

    Thanks

    https://wordpress.org/plugins/relevanssi/

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

    (@msaari)

    You can’t. Singular matches to plural, because the fuzzy searching makes “cat” match to any word that begins with “cat” – “cats”, but also “catastrophe”, “cattle” and “catharsis”.

    However, Relevanssi doesn’t know that when you search for “cats”, you also mean “cat”. How could it know? It doesn’t have any understanding of language. You can’t just go removing letter “s” from the end of the search terms, either, because not all words that end with “s” are plurals.

    There is a solution, though, and that involves buying Premium. Premium includes a simple stemmer, which you can enable. The stemmer will strip the most common suffixes from words, both in the database and in the search queries, causing “cat” and “cats” to be equivalent, even without fuzzy search enabled.

    Thread Starter salvador21

    (@salvador21)

    Thanks, I got premium now.

    I can’t seem to find any detailed info on the stemmer.

    can you please explain about the stemmer, how would i remove the plural (s)

    Plugin Author Mikko Saari

    (@msaari)

    The installing instructions are on the Relevanssi Premium settings page in the sidebar. It’s very simple, just add this line to your theme functions.php:

    add_filter('relevanssi_stemmer', 'relevanssi_simple_english_stemmer');

    Then just reindex the database.

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

The topic ‘Results for singular and plural’ is closed to new replies.