Refresh API and parent child routing


(Jilles van Gurp) #1

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d48ee342-41eb-4897-9240-915c8c27ccb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2