# Mapping/querying question for array of nested object

**URL:** <https://discuss.elastic.co/t/mapping-querying-question-for-array-of-nested-object/8148>\
**Category:** Elasticsearch\
**Created:** [June 18, 2012, 10:56pm UTC](https://discuss.elastic.co/t/mapping-querying-question-for-array-of-nested-object/8148 "2012-06-18T22:56:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roly\_Vicaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roly_vicaria/32/506_2.png) [@Roly\_Vicaria](https://discuss.elastic.co/u/Roly_Vicaria)\
**Post date:** [June 18, 2012, 10:56pm UTC](https://discuss.elastic.co/t/mapping-querying-question-for-array-of-nested-object/8148/1 "2012-06-18T22:56:25Z")

</div>

Hi,

Currently, my document structure looks something like this:

{  
"localizedStr" : [  
{"en-us" : "someValue"},  
{"es-es" : "algunValor"},  
....  
]  
}

I have explicitly included in my mapping every possible culture-locale that  
we currently support. My fear is that when we add more to the system, I  
have to update my mapping.

This led me to consider an alternative document structure:

{  
"localizedStr" : [  
{ "culture" : "en-us", "value" : "someValue"},  
{ "culture" : "es-es", "value" : "algunValor"},  
...  
]  
}

With this structure I know I can easily add more cultures to the system  
without having to change my mapping, but I'm not exactly sure how I can  
query for a value in a specific culture-locale.  
For example: if I were to query for localizedStr.culture : "en-us" AND  
localizedStr.value : "algunValor", this document would be returned,  
although that's not what I want.

Can someone provide some input on which of these makes most sense? If it's  
the second one, then how do I query values for a specific culture-locale?

Thanks.

---

<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:23am UTC](https://discuss.elastic.co/t/mapping-querying-question-for-array-of-nested-object/8148/2 "2017-07-06T03:23:32Z")

</div>


