# Multilingual Search

**URL:** <https://discuss.elastic.co/t/multilingual-search/307734>\
**Category:** Elasticsearch\
**Created:** [June 21, 2022, 8:38am UTC](https://discuss.elastic.co/t/multilingual-search/307734 "2022-06-21T08:38:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ts90](https://avatars.discourse-cdn.com/v4/letter/t/e495f1/32.png) [@ts90](https://discuss.elastic.co/u/ts90)\
**Post date:** [June 21, 2022, 8:38am UTC](https://discuss.elastic.co/t/multilingual-search/307734/1 "2022-06-21T08:38:53Z")

</div>

Hi,

I am working on a project to perform multilingual full-text search using Elasticsearch. one field can contain a word combination of different languages or transliteration. for example in the English text may contain Armenian words. or Russian words in the Armenian text. and i am trying now to configure text analysis with language analyzer.  
in my case don't know what language it is before indexing.

```auto
{
  "settings": {
    "analysis": {
      "filter": {
        "armenian_stop": {
          "type": "stop",
          "stopwords": "_armenian_"
        },
        "armenian_keywords": {
          "type": "keyword_marker",
          "keywords": [
            "օրինակ"
          ]
        },
        "armenian_stemmer": {
          "type": "stemmer",
          "language": "armenian"
        },
        "russian_stop": {
          "type": "stop",
          "stopwords": "_russian_"
        },
        "russian_keywords": {
          "type": "keyword_marker",
          "keywords": [
            "пример"
          ]
        },
        "russian_stemmer": {
          "type": "stemmer",
          "language": "russian"
        },
        "graph_synonyms": {
          "type": "synonym",
          "synonyms_path": "analysis/synonym.txt"
        }
      },
      "analyzer": {
        "rebuilt_armenian": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "armenian_stop",
            "armenian_keywords",
            "armenian_stemmer",
            "graph_synonyms"
          ]
        },
        "rebuilt_russian": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "russian_stop",
            "russian_keywords",
            "russian_stemmer"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "age": {
        "type": "integer"
      },
      "email": {
        "type": "keyword"
      },
      "name": {
        "type": "text",
        "fields": {
          "ar": {
            "type": "text",
            "analyzer": "rebuilt_armenian"
          },
          "ru": {
            "type": "text",
            "analyzer": "rebuilt_russian"
          }
        }
      },
      "location": {
        "type": "geo_point"
      }
    }
  }
}

```

query:  
and as far as I understand it is necessary to search for specific fields, if you search for example by "name" then the standard analyzer will work  
Am I doing everything right?

```auto
{
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "fields": ["name.ar", "name.ru"],
            "query": "ներմուծված"
          }
        }
      ],
      "filter": [
        {
          "geo_distance": {
          "distance": "25km",
          "location": {
            "lat": 40.79420000	,
            "lon": 43.84528000
          }
        }
        }
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 19, 2022, 8:39am UTC](https://discuss.elastic.co/t/multilingual-search/307734/2 "2022-07-19T08:39:17Z")

</div>

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