Developer forum

Forum » Ecommerce - Standard features » Improving Search Results Singular/Plural Terms and Synonyms

Improving Search Results Singular/Plural Terms and Synonyms

Ferri Halfhide
Reply
Hi Guys,
 
On behalf of our client, we’d like to improve the search functionality in our environment. This involves two things:
 
  1. Improving search results for singular/plural terms
    We’re noticing a significant difference in results between singular and plural terms.
    For example, on the Dutch website:
    • Searching for “schuurschijf” (singular) gives only 5 results.
      image
       
    • Searching for “schuurschijven” (plural) gives almost double the results.
      image
       
     
    How or where can we adjust this? I can’t find any clear explanation in the documentation.
    Our goal is to ensure that both singular and plural terms return more consistent and complete results.
  2. Implementing synonyms
    I saw that there’s a tutorial explaining how to configure this with the index, but I’m wondering - how do we decide which analyzer to use for each language, since we have multiple languages on the site? Or am I misunderstanding how this works?
Hopefully, someone can provide a clear answer or point us in the right direction.

Kind regards,
Ferri

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Ferri

Different languages have different needs for being "Analyzed" and be able to be searched like you mention.

The way to do that in DW10 using lucene is to create "custom field types" using an analyzer - and based on that custom field type, add custom fields to the index for searching in the different languages

https://doc.dynamicweb.dev/documentation/implementing/repositories/indexes/index.html?tabs=simplefields#custom-field-types

https://doc.dynamicweb.dev/documentation/implementing/repositories/indexes/index.html?tabs=simplefields#manually-adding-fields

Create a custom text search field for each language - choose an analyzer for that language

Create text fields in the index for e.g. product name and description:

Then create a summary field using those dutch analyzed fields:

And then add the summary field to the query using the q-parameter (or whatever you use in your setup):

Then do this for all languages - you would then have several summary fields in different languages on the same query - and that is fine - that will not be an issue.

I understand it is quite a setup - but this is how it is done.

BR Nicolai

 

You must be logged in to post in the forum