Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t think the referenced inflector class is still available, but due to how search terms are handled, it’s probably not necessary. WP automatically adds SQL wildcards to search terms which are then used in a LIKE query. I think it should be fairly safe (in English at least) to arbitrarily strip pluralizing letters like s, es, and ies off of terms without regard for it being grammatically correct because the original terms will still be found. The biggest problem is invalid search results could be returned.

    For example, the search terms “fishing flies”. If you stripped the “ies” from flies, the SQL search query will be for %fl%, which will correctly match “fly” and “flies”, but also match fluid, flip, flounder, fleece, etc. You’ll have to decide if this is a reasonable risk or not. Perhaps you could only strip pluralizing letters if the resulting root is at least 3 or 4 letters to help prevent undesirable results?

Viewing 1 replies (of 1 total)
  • The topic ‘Display search results for singular terms in plural is searched’ is closed to new replies.