# Multilingual index options: \_analyzer or multiple mappings or?

**URL:** <https://discuss.elastic.co/t/multilingual-index-options--analyzer-or-multiple-mappings-or/6382>\
**Category:** Elasticsearch\
**Created:** [January 14, 2012, 8:55am UTC](https://discuss.elastic.co/t/multilingual-index-options--analyzer-or-multiple-mappings-or/6382 "2012-01-14T08:55:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [January 14, 2012, 8:55am UTC](https://discuss.elastic.co/t/multilingual-index-options--analyzer-or-multiple-mappings-or/6382/1 "2012-01-14T08:55:24Z")

</div>

Hi,

What's the best way to handle an index with multilingual docs (e.g., 1  
lang per doc, but not all docs in the same language)?

Is explicitly specifying the language-specific analyzer via \_analyzer  
for each field at index time the best approach?  
See [http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html](http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html)

Or would this work better:

curl -XPOST localhost:9200/test -d '{  
"mappings" : {  
"english" : {  
"properties" : {  
"title" : { "type" : "string", "index" : "analyzed" },  
"pubDate" : { "type" : "date", "index" : "analyzed" }  
}  
},  
"french" : {  
"properties" : {  
"title" : { "type" : "string", "index" : "analyzed" },  
"pubDate" : { "type" : "date", "index" : "analyzed" }  
}  
}

```
}

```

}'

Or maybe there is some other option I'm missing?

## Thanks, Otis

Sematext is hiring world-wide -- [http://sematext.com/about/jobs.html](http://sematext.com/about/jobs.html)

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [January 14, 2012, 9:47am UTC](https://discuss.elastic.co/t/multilingual-index-options--analyzer-or-multiple-mappings-or/6382/2 "2012-01-14T09:47:01Z")

</div>

Hi Otis

> What's the best way to handle an index with multilingual docs (e.g., 1  
> lang per doc, but not all docs in the same language)?
> 
> Is explicitly specifying the language-specific analyzer via \_analyzer  
> for each field at index time the best approach?  
> See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html)

I'd say this is your best option, so when you index your doc, you can  
just add a field that indicates which analyzer to use, and any field  
which doesn't have a specific analyzer set will use this "dynamic"  
analyzer instead.

clint

---

<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 6, 2017, 3:42am UTC](https://discuss.elastic.co/t/multilingual-index-options--analyzer-or-multiple-mappings-or/6382/3 "2017-07-06T03:42:45Z")

</div>


