Developer forum

Forum » Development » Plurals in search

Plurals in search

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

We have a customer who would like to have a search that understands plural forms of words. For example if the word "Hinge" gets in some searchresults, then the word "Hinges" should render the same results. 

Would that be achieved with the synonyms analyzer or are there perhaps other/better solutions?

Regards / Aki


Replies

 
Nicolai Pedersen
Reply

Hi Aki

Yes, synonyms can take of that. Synonyms is a bit tricky - see some of the threads with Nuno on this.

The configuration of the Synonyms look like this:

<?xml version="1.0" encoding="utf-8" ?>
<SynonymAnalyzer>
  <TokenizerType>
    LowerCase
  </TokenizerType>
  <StemmerName>
    English
  </StemmerName>
  <StopWords>
  </StopWords>
</SynonymAnalyzer>

Stemming is the plural handling. So this configuration will take care of english stemming, which is your example. Different languages have different stemming rules, and might need different stemmers. But Lucene only has a limited set of stemmers for lucene.net in this version...

If you have other languages, you can also use synonyms for plurals - but that would be a long list.

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright. 

Thanks for the input. yes

Regards / Aki

 

 

You must be logged in to post in the forum