# Query with partial fields does not return nested arrays values

**URL:** <https://discuss.elastic.co/t/query-with-partial-fields-does-not-return-nested-arrays-values/8732>\
**Category:** Elasticsearch\
**Created:** [August 13, 2012, 6:35pm UTC](https://discuss.elastic.co/t/query-with-partial-fields-does-not-return-nested-arrays-values/8732 "2012-08-13T18:35:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilya\_Korniyko](https://avatars.discourse-cdn.com/v4/letter/i/f04885/32.png) [@Ilya\_Korniyko](https://discuss.elastic.co/u/Ilya_Korniyko)\
**Post date:** [August 13, 2012, 6:35pm UTC](https://discuss.elastic.co/t/query-with-partial-fields-does-not-return-nested-arrays-values/8732/1 "2012-08-13T18:35:37Z")

</div>

I did  
curl -XPUT [http://localhost:9200/test/a/c](http://localhost:9200/test/a/c) -d "{ "list" : ["1"],  
"nest\_list" : [["1"]] }"  
{"ok":true,"\_index":"test","\_type":"a","\_id":"c","\_version":1}

Now  
curl -XPOST [http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true) -d "{ "query"  
: { "match\_all" : {}}}"

gives

{  
"took" : 2,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "test",  
"\_type" : "a",  
"\_id" : "c",  
"\_score" : 1.0, "\_source" : { "list" : ["1"], "nest\_list" : [["1"]]  
}  
} ]  
}  
}

While with partial fields, nested arrays are not returned  
curl -XPOST [http://localhost:9200/\_search](http://localhost:9200/_search)? -d "{ "query" : {  
"match\_all" : {}}, "partial\_fields" : { "partial" : {  
"exclude":"nothing" } } }"

{  
"took" : 1,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "test",  
"\_type" : "a",  
"\_id" : "c",  
"\_score" : 1.0,  
"fields" : {  
"partial" : {  
"nest\_list" : [],  
"list" : ["1"]  
}  
}  
} ]  
}  
}

--

---

<div class="post-metadata">

**Author:** ![Mark\_Huang\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_huang_2/32/2641_2.png) [@Mark\_Huang\_2](https://discuss.elastic.co/u/Mark_Huang_2)\
**Post date:** [August 16, 2012, 6:39am UTC](https://discuss.elastic.co/t/query-with-partial-fields-does-not-return-nested-arrays-values/8732/2 "2012-08-16T06:39:44Z")

</div>

I'm pretty new to this whole Elasticsearch thing but if I'm not mistaken,  
you didn't specify what fields to include; you only specified what fields  
to exclude. I'm also using partial fields actively and I have no problems.  
You have to specify what fields to include.

On Monday, 13 August 2012 13:35:37 UTC-5, Ilya Korniyko wrote:

> I did  
> curl -XPUT [http://localhost:9200/test/a/c](http://localhost:9200/test/a/c) -d "{ "list" : ["1"],  
> "nest\_list" : [["1"]] }"  
> {"ok":true,"\_index":"test","\_type":"a","\_id":"c","\_version":1}
> 
> Now  
> curl -XPOST [http://localhost:9200/\_search?pretty=true](http://localhost:9200/_search?pretty=true) -d "{  
> "query" : { "match\_all" : {}}}"
> 
> gives
> 
> {  
> "took" : 2,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 1,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "test",  
> "\_type" : "a",  
> "\_id" : "c",  
> "\_score" : 1.0, "\_source" : { "list" : ["1"], "nest\_list" :  
> [["1"]] }  
> } ]  
> }  
> }
> 
> While with partial fields, nested arrays are not returned  
> curl -XPOST [http://localhost:9200/\_search](http://localhost:9200/_search)? -d "{ "query" : {  
> "match\_all" : {}}, "partial\_fields" : { "partial" : {  
> "exclude":"nothing" } } }"
> 
> {  
> "took" : 1,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 1,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "test",  
> "\_type" : "a",  
> "\_id" : "c",  
> "\_score" : 1.0,  
> "fields" : {  
> "partial" : {  
> "nest\_list" : ,  
> "list" : ["1"]  
> }  
> }  
> } ]  
> }  
> }

--

---

<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:16am UTC](https://discuss.elastic.co/t/query-with-partial-fields-does-not-return-nested-arrays-values/8732/3 "2017-07-06T03:16:12Z")

</div>


