Algolia search exact match for french accents

Hello,

I am working on a search for food products (with brands and categories in the search). Indexing went well but after some tests, the client gave me a feedback that I can’t find a solution to.

Having search hits for the query “sel” (salt in french) :

{
  "hits": [
    {
      "contentType": "product",
      "name": "Sel à la truffe",
   },
   {
      "contentType": "product",
      "name": "HUILE D'OLIVE SELECTION",
   },
  {
      "contentType": "category",
      "name": "Sélection du marché",
   }
 ]
}

The first result is perfectly what I want.
For this particular word (and maybe some others cases that we didn’t discover yet) I want to have a strict match (without accent and just 3 letters “sel”).

Is there a way to restrain results without accent and exact-match for specific words like sel ?

I have tried to use Disable typo tolerance on words in the config but without success.

Thank you

By default, Algolia normalizes all characters and strips away diacritics like graves and accents. You can disable this behavior for certain characters using keepDiacriticsOnCharacters API parameter | Algolia, but not certain words.

Creating a list of diacritics you want to honor in your search results is probably the closest way to get the behavior you’re looking for. @nicolas.pineau.p recently had a similar question and may be able to offer some additional tips: Issues with facet values

Hello @chuck.meyer ,

With the mix of diacriticsOnCharacters and searchableAttributes I’m now able to get better results. Disabling the normalisation for certain characters seems enough in my case.

Your answer and the links you shared really helped. French language and normalisation definitely brings some challenges.

Thank you !

2 Likes