Need help to properly map French cities for multi fields search and autocomplete

Hi,

I'm currently working on French geolocation data.

Here is my model:

public class Ville
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public string ZipCode { get; set; }

        public string[] MultilpleZipCopde { get; set; }
        
        public GeoLocation Centroide { get; set; }
        
        public GeoLocation Min { get; set; }
        
        public GeoLocation Max { get; set; }
    }

I need to be able to perform quick search such as:

  • search by name

  • search by zip code

  • perform autocomplete

I've facing some issues with:

  • the French language when there is an accent in the city name

  • the search on the zip code, the result of my search is empty when I set a zip code

I'm using ElasticSearch v7.2, .netCore, C#, Nest v7.0.1

Can someone give me a proper way to design my index's mapping & settings, please ?
I appreciate your help.

Thanks in advance,

Patrice

You can use the french analyzer or add an asciifolding token filter if you are using custom analyzer.

I wrote some examples at the end of this gist:

HTH

Hi David,

Thanks for your quick reply. Your examples help me a lot.
I'm now able to search by name or zip code, even with accents!! :wink:

Thanks again!! :slight_smile:

Patrice

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.