Partial text search or Atlas seacrh index with diacriticSensitive are not working

Hello,

my task is simple:
to find results based on query with skipping diacritic sensitive.

What problems I am facing:
$text indes is not supporting partial text search: https://jira.mongodb.org/browse/SERVER-15090
$search - when using together with Atlas search index is not suporting diacritic - meaning if i search for world Ruosiamasi it will not find world Ruošiamasi.

What should I do? I never thought that mongo has such limitation!
I am stuck. Please advice.

Thanks

Hello @Vytautas_Pranskunas ,

You can use a custom analyzer and run a diacritic-insensitive query. I would recommend the following documentation on How to Define a Custom Analyzer and Run a Diacritic-Insensitive Query which may suit your use case.

Regards,
Tarun

1 Like

Hi, i will check custom analyzers but i think this is a common use car for all non English alphabets so what about supporting partial text search on $text index?

Ok i was able to do my indexes following your totorial but i have few more questions:

  1. how can i add these search indexes via migrations using nodejs mongodb client, because every time i recreat db index is lost
  2. i have document structured like this:
    {
    …,
    title: { lt: ‘some text’, en: ‘some text’ }

    },
    currently i am specifying index to each of my sub props like this like this:
{
  "mappings": {
    "dynamic": false,
    "fields": {
      "title": {
        "type": "document",
        "fields": {
          "lt": {
            "analyzer": "diacriticFolder",
        "searchAnalyzer": "diacriticFolder",
        "type": "string"
          },
 "en": {
            "analyzer": "diacriticFolder",
        "searchAnalyzer": "diacriticFolder",
        "type": "string"
          }
        }
      }
    }

is there any way to dynamic to sub field that all nested fields are indexed? because if at some point we decide to add new language we will have to not forget to create new index.

  1. how to mimi atlas search index in dev environment because we are running all development locally also and without this index search will not function.