# Best practices for multi language search and index

**URL:** <https://discuss.elastic.co/t/best-practices-for-multi-language-search-and-index/206086>\
**Category:** Elasticsearch\
**Created:** [October 31, 2019, 5:18pm UTC](https://discuss.elastic.co/t/best-practices-for-multi-language-search-and-index/206086 "2019-10-31T17:18:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ixsorribas](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@ixsorribas](https://discuss.elastic.co/u/ixsorribas)\
**Post date:** [October 31, 2019, 5:18pm UTC](https://discuss.elastic.co/t/best-practices-for-multi-language-search-and-index/206086/1 "2019-10-31T17:18:47Z")

</div>

Hi, i´m new 🙂

I have the next scenario: a document with a nested field that includes one or more "blocks" with a text field each. That text field could be in one of four different languages. (I know the language of each block). Different "blocks" of same document could be in different languages.

What is a better approach for my index?

A) Always fill the field 'content' and all of its sub-fields

```
 	"content":{
		"type": "text",
		"fields": {
			"es": {
				"type": "text",
				"analyzer": "rebuilt_spanish"
			},
			"en": {
				"type": "text",
				"analyzer": "rebuilt_english"
			},
			(...)
		}
	}

```

B) Pre-process the data to index and fill the proper field of each block leaving the others empty:

```
	"contentES":{
		"type": "text",
		"fields": {
			"es": { 
				"type": "text",
				"analyzer": "rebuilt_spanish"
			}
		}
	},
	"contentEN":{
		"type": "text",
		"fields": {
			"en": { 
				"type": "text",
				"analyzer": "rebuilt_english"
			}
		}
	}
	(...)

```

Is it too many memory and space consumption in case A) ?  
It is easier for me to produce the data to index in first case, ignoring the language.  
In both cases, i will do a multi\_field search.

What do you think?  
Thank you!!

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [October 31, 2019, 6:35pm UTC](https://discuss.elastic.co/t/best-practices-for-multi-language-search-and-index/206086/2 "2019-10-31T18:35:34Z")

</div>

The Definitive Guide seems to [suggest option A](https://www.elastic.co/guide/en/elasticsearch/guide/current/mixed-lang-fields.html#_analyze_multiple_times) for you, but it's worth reading that whole chapter to evaluate the trade-offs of the other approaches to dealing with human language. As the doc says, mixed language fields "are the most difficult type of multilingual document to handle correctly".

---

<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:** [November 28, 2019, 6:35pm UTC](https://discuss.elastic.co/t/best-practices-for-multi-language-search-and-index/206086/3 "2019-11-28T18:35:40Z")

</div>

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