# Child\_type field order in hash\_child json block changes the ouput result

**URL:** <https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794>\
**Category:** Elasticsearch\
**Created:** [April 3, 2014, 3:38pm UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794 "2014-04-03T15:38:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_oo](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@Giovanni\_oo](https://discuss.elastic.co/u/Giovanni_oo)\
**Post date:** [April 3, 2014, 3:38pm UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794/1 "2014-04-03T15:38:37Z")

</div>

The order of "child\_type" generated using Java API for DSL queries, seems  
to be wrong, the attached generated json does not carry out results.  
The problems seems to be due to the position of that field position. Moving  
the "child\_type" before "query", the json query works ok.

"has\_child" : {  
"query" : {  
"query\_string" : {  
"query" : "iPhone",  
"fields" : ["ResourceURI"]  
}  
},  
"child\_type" : "facebookChild",  
"score\_type" : "sum"  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/088cd282-9af2-41e1-94b1-c6cd3d7dd43a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/088cd282-9af2-41e1-94b1-c6cd3d7dd43a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [April 3, 2014, 10:01pm UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794/2 "2014-04-03T22:01:36Z")

</div>

I think you meant "type" instead of "child\_type":

"has\_child" : {  
"query" : {},  
"type" : "facebookChild",  
"score\_type" : "sum"  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8b57ce8a-a6b9-4a5e-b5e4-4e622f609e58%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b57ce8a-a6b9-4a5e-b5e4-4e622f609e58%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Giovanni\_oo](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@Giovanni\_oo](https://discuss.elastic.co/u/Giovanni_oo)\
**Post date:** [April 4, 2014, 7:36am UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794/3 "2014-04-04T07:36:45Z")

</div>

The Java API generates "child\_type" field. However I read the Elasticsearch  
Java code and "child\_type" is like the "type" field.

Il giorno venerdì 4 aprile 2014 00:01:36 UTC+2, Binh Ly ha scritto:

> I think you meant "type" instead of "child\_type":
> 
> "has\_child" : {  
> "query" : {},  
> "type" : "facebookChild",  
> "score\_type" : "sum"  
> }

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3e215230-86ed-4c75-829d-1adef0570853%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3e215230-86ed-4c75-829d-1adef0570853%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [April 4, 2014, 8:43pm UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794/4 "2014-04-04T20:43:20Z")

</div>

You're right. I still can't seem to reproduce your problem. May I ask which  
version of ES?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c1c9f2c7-466e-4bef-a3f8-1aeebb36cd4b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c1c9f2c7-466e-4bef-a3f8-1aeebb36cd4b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:38am UTC](https://discuss.elastic.co/t/child-type-field-order-in-hash-child-json-block-changes-the-ouput-result/16794/5 "2017-07-06T01:38:03Z")

</div>


