# Parent field is sometimes empty

**URL:** <https://discuss.elastic.co/t/parent-field-is-sometimes-empty/6052>\
**Category:** Elasticsearch\
**Created:** [December 2, 2011, 2:37pm UTC](https://discuss.elastic.co/t/parent-field-is-sometimes-empty/6052 "2011-12-02T14:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)\
**Post date:** [December 2, 2011, 2:37pm UTC](https://discuss.elastic.co/t/parent-field-is-sometimes-empty/6052/1 "2011-12-02T14:37:54Z")

</div>

Hello

I have following situation:

2-node ES cluster (version 0.17.8) with parent-child mapping.  
I indexed a document as a parent and then indexed a few documents as its  
children.  
If I go to url:  
[http://node:9200/](http://node:9200/)/\<child\_type\_name\>/\<child\_id\>?fields=\_parent,\_source  
I get sometimes response with \_parent field and sometimes without it.  
If I continue to refresh this url in my browser, \_parent field shows and  
disappears alternatingly.  
It suggests that this request is routed alternatingly to both ES nodes and  
one node contains value of \_parent field and second one doesn't.  
Restart of node without this field solves problem.

Is it a bug?

Regards  
Wojciech Durczyński

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 2, 2011, 2:46pm UTC](https://discuss.elastic.co/t/parent-field-is-sometimes-empty/6052/2 "2011-12-02T14:46:55Z")

</div>

In 0.17, realtime get, which works by getting the document indexed from the  
transaction log, did not return the \_parent field. Its fixed in 0.18. In  
your case, probably one shard flushed and got the document from the index  
itself, and another shard was getting it from the transaction log (fetching  
\_parent not supported in 0.17).

2011/12/2 Wojciech Durczyński [wojciech.durczynski@comarch.com](mailto:wojciech.durczynski@comarch.com)

> Hello
> 
> I have following situation:
> 
> 2-node ES cluster (version 0.17.8) with parent-child mapping.  
> I indexed a document as a parent and then indexed a few documents as its  
> children.  
> If I go to url: [http://node:9200/](http://node:9200/)  
> /\<child\_type\_name\>/\<child\_id\>?fields=\_parent,\_source  
> I get sometimes response with \_parent field and sometimes without it.  
> If I continue to refresh this url in my browser, \_parent field shows and  
> disappears alternatingly.  
> It suggests that this request is routed alternatingly to both ES nodes and  
> one node contains value of \_parent field and second one doesn't.  
> Restart of node without this field solves problem.
> 
> Is it a bug?
> 
> Regards  
> Wojciech Durczyński

---

<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:46am UTC](https://discuss.elastic.co/t/parent-field-is-sometimes-empty/6052/3 "2017-07-06T03:46:36Z")

</div>


