# Refresh API and parent child routing

**URL:** <https://discuss.elastic.co/t/refresh-api-and-parent-child-routing/18412>\
**Category:** Elasticsearch\
**Created:** [July 1, 2014, 10:20am UTC](https://discuss.elastic.co/t/refresh-api-and-parent-child-routing/18412 "2014-07-01T10:20:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jilles\_van\_Gurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jilles_van_gurp/32/879_2.png) [@Jilles\_van\_Gurp](https://discuss.elastic.co/u/Jilles_van_Gurp)\
**Post date:** [July 1, 2014, 10:20am UTC](https://discuss.elastic.co/t/refresh-api-and-parent-child-routing/18412/1 "2014-07-01T10:20:27Z")

</div>

I have a bit of functionality where I occasionally need to refresh  
documents so I can guarantee queries actually include recent modifications.  
Disclaimer, I'm of course aware that this is not a great practice.

I'm using parent child relations and was wondering if I can restrict the  
refresh API to the shard where my child documents live with the parentId.  
So, I tried.

This fails with a Mapper exception:  
POST /myindex/mytype\_refresh?parent=myparentId

{  
"error": "MapperParsingException[failed to parse, document is empty]",  
"status": 400  
}

This succeeds but simply refreshes all the shards instead of just the shard  
I want refreshed:  
POST /myindex/\_refresh?parent=myparentId  
{  
"\_shards": {  
"total": 10,  
"successful": 10,  
"failed": 0  
}  
}

same for POST /myindex/\_refresh?routing=myparentId

Is there a way to refresh just the shard with the child documents + parent?  
It seems to me that refreshing just one shard would be cheaper.

Jilles

--  
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/d48ee342-41eb-4897-9240-915c8c27ccb0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d48ee342-41eb-4897-9240-915c8c27ccb0%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:18am UTC](https://discuss.elastic.co/t/refresh-api-and-parent-child-routing/18412/2 "2017-07-06T01:18:44Z")

</div>


