Developer forum

Forum » Development » Supporting plural in search

Supporting plural in search

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I need to include support for plurals in some of our projects.
There have been a few other threads on this (or similar) topic, but I figured time passed and we might have better options this time.
I understand that the standard version does not support (yet) Romanian, but it may be useful to understand the steps I need to take to include it as a customization.
Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

Sorry - this will be a bit technical....

To normalize romanian, you need to use an Analyzer that understands the romanian language - Lucene actually has that already:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Analysis.Common/Analysis/Ro/RomanianAnalyzer.cs

It uses a stemmer like this to handle Romanian:
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Analysis.Common/Tartarus/Snowball/Ext/RomanianStemmer.cs

To use another analyzer than the "StandardAnalyzer" as Dynamicweb uses by default, you have to create a field type in Dynamicweb that uses another analyzer:

The problem is currently, that we only list analyzers that has parameter less constructors - which most of these analyzers do not have. That is why the list of potential analyzers is short.

Most of these analyzers have another constructor we can use - so I just made a change so we can list and use most analyzers in the lucene project. This requires a release from us.

If you cannot wait, you can make a copy of the RomanianAnalyzer from the above Git repo (Name it e.g. CustomRomanianAnalyzer), give it a constructor with no arguments that will call the current constructor with the value of Lucene.Net.Util.LuceneVersion field and upload that dll to DW - and you can use it right away,.

But as I wrote - we made the change so it will be rolling out end of month.

BR Nicolai

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/25002

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have found an older implementation of ours (based on your suggestions) for DW9.

For Dw10 I would rather wait for your update.

Thank you very much,

Adrian

 

You must be logged in to post in the forum