Gossamer Forum
Quote Reply
plurals
Hi,

I wonder if anyone can help me.
if I search for estate agent I get a result but if I search estate agents I get different results and the non 's' from estate agents is not included.

it gets harder with things such as agency or agencies (and vice versa too from ies to y) but if anyone has a solution to this I would be grateful, I would happily pay for a plugin if necc.

Is there any natural language solution available, it is a bit of a hole for me and often no results are returned when I have entries that are not singular

many thanks,

Kevin

Cheers
KevM
Quote Reply
Re: [KevM] plurals In reply to
Hi,

I had a similar problem that lots of people were searching for plurals and not getting any results.
I have modified Search.pm so that if the search is a substring and there is an s on the end it is removed. However, I didn't get any more complicated than that. You could do a similar thing and take off 'ies', 'es', etc as well. As long as you are searching for substrings you don't need to replace these - but in some cases you might get non-relevant results.

In sub query in Search.pm just add the line

(if $args->{substring} eq '1') {$args->{query} =~ s/s$//;}

after

$args->{query} =~ s/\s+$//;

I don't think it is easy to write a plugin for this as I think that the whole query sub would need replacing.
Quote Reply
Re: [afinlr] plurals In reply to
Hi,

It's a bit of a shame it is so tricky, I have been looking at this (see thread link below) which I might consider as an alternative

http://www.gossamer-threads.com./...orum.cgi?post=275691

Hope you are well,

Kev

Cheers
KevM