Developer forum

Forum » Ecommerce - Standard features » Configuration of Synonim search

Configuration of Synonim search

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to set up a Synonym search on a project.

I have followed the steps described here: https://doc.dynamicweb.com/documentation-9/how-tos/general/synonyms

But I cannot make it work. I am thinking maybe there is something wrong with the configuration.

In the WithSynonyms.config file, I see a couple of options, one of them being StemmerName. I have kept the sample value (English) but my site's main language is Norwegian BokmÃ¥l.

Do I need to configure a specific Stemmer for it to work?

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply

The stemming handles different versions or soundings of words. I.e. plural version like "bike" and "bikes", but also sound alikes like "bikez" and "bikes" that sounds the same. So the stemming will ensure that "bike", "bikes", "bikez", "bikkes" etc are all indexed as "bike" and when searching you will find "bike" when searching for "bikes"

Synonyms can work regardles of the stemming. Synonyms would be other wors. I.e. "cycle" will become "bike".

But if you want to do stemmings as well as synonyms, you could benefit from a norwegian stemmer for your index. You can try "Norwegian" as the stemming. But that is not what is wrong with your setup.

See my setup attached.

Capture.JPG Capture2.PNG Capture3.JPG
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the details.

I have attached my setup. Unless I am missing some Type, the only difference is that your field is also Saved while mine is just Indexed and Analysed

Synonyms1.png Synonyms2.png Synonyms3.png Synonyms4.png
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have checked my index using Luke and it seems that the value stored for productNameWithSynonyms is the same as the one for ProductName (which is supposed to be the source).

Which means that the configuration might be off.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have managed to figure out the difference.

I have initially considered group stem value as the keyword that has to be evaluated as a synonym. I have noticed in your example that you have used fast both as a group stem name and as a synonym.

I have done the same with my setup and I have included a custom string in the list of synonyms (adrian) in order to avoid any overlapping terms. 

And it WORKED!

However, the problem still needing a fix is the situation where the synonym contains a number.

If you look at my example, I was trying to match 6kt to sekskanskruer. Every other synonym works (including adrian) but not 6kt nor in6kt.

Maybe there are some issues with synonyms containing numbers?

Thank you,

Adrian

 
Nicolai Pedersen
Reply

Cant tell. It is probably something related to how Lucene handles this. It could be stemming that does not want numbers in the text. So try using stem="sekskanskruer" and not "6kt" and see if it makes a difference.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have tried it but the behavior is the same. It works for strings but not for combined numeric+strings no matter where the numbers are located inside the string.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Any other suggestions? I really need to make this work and I have no idea if it's something I can control or it's something that you guys should fix.

Thank you,

Adrian

 
Nicolai Pedersen
Reply

I do not think I can fix that.

The synonyms filter uses a tokenizer/analyzer inside that will split 6kt to 2 terms (6 and kt). So you would have to create another version of that analyzer that does not do this.

I guess you would have the same issue if you just index it with standard analyzer that it will become 2 terms and an fieldname<equals>6kt would probably also not work.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for your answer.

I don't think I will go over the trouble to create a custom analyzer because it is way out of our knowledge.

Is this something you would plan on including in future releases? I don't see it as an exception to our situation and it might be good to have built-in functionality that supports it rather than something custom.

Thank you,

Adrian

 

You must be logged in to post in the forum