# How to query object array?

**URL:** <https://discuss.elastic.co/t/how-to-query-object-array/95961>\
**Category:** Elasticsearch\
**Created:** [August 5, 2017, 2:06am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961 "2017-08-05T02:06:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [August 5, 2017, 2:06am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/1 "2017-08-05T02:06:38Z")

</div>

here is the document

```
{
   "2": {
        "20170804" :{
            "7": [{"loc":[1, 2], "ts":1}],
            "5": [{"loc":[1, 2], "ts":1}]
        }
    }
}

```

how to query ts field?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 5, 2017, 2:24am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/2 "2017-08-05T02:24:51Z")

</div>

You can query:

- "2.20170804.7.ts"
- "2.20170804.5.ts"

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [August 5, 2017, 3:01am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/4 "2017-08-05T03:01:38Z")

</div>

ive tried. but it does not work

ive test the mapping.

## i’ve found that a field name could not be found when having these parameter settings.

– “enabled”:false,  
– “dynamic”:false  
i thought these settings only make the value not being indexed.  
but now , the field name of these field could not be found.  
and i've checked the mapping. these field did be added to the mapping.  
but could not found when i use query like this:

```
curl -XGET 'http://172.16.4.240:9200/local3/places/_search' -d '
{
    "query": {
        "exists" : { "field" : "l" }
    }
}
'

```

i know it would not reduce the efficiency when i found a document.  
but will it take a long time when i extract some fields when one document is very big?

- i only need to extract the field which is set to "enabled":false, which means that the value not need to be indexed
- i know the field which value is set to "dynamic":false will not be indexed or added the filed in value to mapping, but i need to find the field name fast when one document could be very large

"enabled":false  
"dynamic":false

the mapping will be updated with new field name while the filed name could not be queried using exist query when the field has one these two settings.  
does it mean the the field's name will not be indexed in a independent index?  
and the field position inside one stored document would be found very efficiency when the field name has added to the mapping?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 5, 2017, 6:32am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/5 "2017-08-05T06:32:08Z")

</div>

In your example, 1 is not a field name.

Again:

Could you provide a full recreation script as described in

> [@About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21):
>
> The heart of the free and open Elastic Stack Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease. warning PLEASE READ THIS SECTION IF IT'S YOUR FIRST POST Some useful links: [elasticsearch reference guide](http://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)[elasticsearch user guide](http://www.elastic.co/guide/en/elasticsearch/guide/current/index.html)[elasticsearch plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)[elasticsearch cl…](https://www.elastic.co/guide/en/elasticsearch/client/index.html)

It will help to better understand what you are doing.  
Please, try to keep the example as simple as possible.

---

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)\
**Post date:** [August 7, 2017, 9:37am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/6 "2017-08-07T09:37:42Z")

</div>

im sorry.  
the problem does exist.  
my post has a mistake

---

<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:** [September 4, 2017, 9:41am UTC](https://discuss.elastic.co/t/how-to-query-object-array/95961/7 "2017-09-04T09:41:35Z")

</div>

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