Plural searches fail

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6566
    jonteeter
    jonteeter
    Participant

    I have noticed a lot of searches fail to catch relevant results simply based on whether they are plural or singular. For example, “keyboards” returns zero results but “keyboard” returns many. “acoustics” returns only 1 product whereas acoustic returns many. Is there a configuration setting that would resolve this? Or is there something simple you can add to improve the search in your next update? Please advise!

    #6571
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Well, there is no simple solution unfortunately, because of the irregular patterns of the singularization – pluralization forms of english language. In many cases adding/removing the “s” from the word ending is not enough.

    I’ve done some research, and looks like there might be a pre-created code that covers most of these cases as well. I’ve made a few changes to integrate it with the search, and it looks like it’s working as a temporary solution.

    Try putting the code on this url to your theme’s functions.php file: http://pastebin.com/raw.php?i=m4q0VF6K

    This will go through all search words inputted and detects if in singular/plural form, then it will append (invisibly to the user) the opposing forms as well to the search phrase.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Plural searches fail’ is closed to new replies.