# Best practices with localized indices

**URL:** <https://discuss.elastic.co/t/best-practices-with-localized-indices/12467>\
**Category:** Elasticsearch\
**Created:** [June 18, 2013, 6:29pm UTC](https://discuss.elastic.co/t/best-practices-with-localized-indices/12467 "2013-06-18T18:29:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_T](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jorge\_T](https://discuss.elastic.co/u/Jorge_T)\
**Post date:** [June 18, 2013, 6:29pm UTC](https://discuss.elastic.co/t/best-practices-with-localized-indices/12467/1 "2013-06-18T18:29:50Z")

</div>

Hi folks,

I'm working on a new implementation, which will be localized to about 20  
languages. I would like to know if there are any best practices in  
structuring index mappings for this kind of scenario. Should I:

1. Have one document per item, and set up language-specific fields (i.e.  
title\_en, title\_fr, etc)
2. Use document types within the same index (i.e.  
/documents/documents\_en, /documents/documents\_fr)
3. Set up separate indicies (i.e. /documents\_en, /documents\_fr)

I have been leaning towards #2. In this case, is it more performant to:

1. Set up a field with the language in the documents, and use a filtered  
query
2. Take advantage of the separate types, and only query  
/documents/documents\_TYPE
3. Some other approach?

I have not found much good info on localization, so I appreciate the  
group's advice.

Best,

Jorge

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [June 19, 2013, 8:39am UTC](https://discuss.elastic.co/t/best-practices-with-localized-indices/12467/2 "2013-06-19T08:39:21Z")

</div>

On Tue, Jun 18, 2013 at 8:29 PM, Jorge T [jorge.alberto.trujillo@gmail.com](mailto:jorge.alberto.trujillo@gmail.com)wrote

> Hi folks,

Hi,

> I'm working on a new implementation, which will be localized to about 20  
> languages. I would like to know if there are any best practices in  
> structuring index mappings for this kind of scenario. Should I:
> 
> 1. Have one document per item, and set up language-specific fields  
> (i.e. title\_en, title\_fr, etc)
> 2. Use document types within the same index (i.e.  
> /documents/documents\_en, /documents/documents\_fr)
> 3. Set up separate indicies (i.e. /documents\_en, /documents\_fr)
> 
> I would say that it depends on your use-case:

- if documents would be the same for all languages, then 1. makes sense  
since it would avoid duplication of data across several indices/types  
(assuming your document have eg. numeric attributes that don't depend on  
the language)
- if documents would be different depending on the language:
  - if you may need to perform cross-languages queries, then different  
types
  - otherwise different indices.

> I have been leaning towards #2. In this case, is it more performant to:
> 
> 1. Set up a field with the language in the documents, and use a  
> filtered query
> 
> 2. Take advantage of the separate types, and only query  
> /documents/documents\_TYPE
> 
> 3. Some other approach?
> 
> 4. does 1. under the hoods so both approaches should be equivalent.

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jorge\_T](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jorge\_T](https://discuss.elastic.co/u/Jorge_T)\
**Post date:** [June 19, 2013, 6:31pm UTC](https://discuss.elastic.co/t/best-practices-with-localized-indices/12467/3 "2013-06-19T18:31:26Z")

</div>

Thank you for the additional clarity Adrien.

-Jorge

On Tuesday, June 18, 2013 2:29:50 PM UTC-4, Jorge T wrote:

> Hi folks,
> 
> I'm working on a new implementation, which will be localized to about 20  
> languages. I would like to know if there are any best practices in  
> structuring index mappings for this kind of scenario. Should I:
> 
> 1. Have one document per item, and set up language-specific fields  
> (i.e. title\_en, title\_fr, etc)
> 2. Use document types within the same index (i.e.  
> /documents/documents\_en, /documents/documents\_fr)
> 3. Set up separate indicies (i.e. /documents\_en, /documents\_fr)
> 
> I have been leaning towards #2. In this case, is it more performant to:
> 
> 1. Set up a field with the language in the documents, and use a  
> filtered query
> 2. Take advantage of the separate types, and only query  
> /documents/documents\_TYPE
> 3. Some other approach?
> 
> I have not found much good info on localization, so I appreciate the  
> group's advice.
> 
> Best,
> 
> Jorge

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:30am UTC](https://discuss.elastic.co/t/best-practices-with-localized-indices/12467/4 "2017-07-06T02:30:21Z")

</div>


