On Wed, May 16, 2012 at 11:14 PM, Юрій Іванович Бондарук
Thanks for the answer.
Now I have another questions:
- Is it possible to search child document in all parent docs by child id
(I don't know the parent) in realtime (as GET operation)?
If you don't know the parent id, then yes, you can do a search for it
- Can I use GET request with specified parent-id + child-id or only POST
Yes, you can do a GET request to get the child document by its id and the
parent. Just specify the parent id in the routing parameter. I will add a
parent parameter option as well...
On Wed, May 16, 2012 at 10:49 PM, Shay Banon firstname.lastname@example.org wrote:
Thats because on top of the id of the child document, you need to provide
the parent id in the parent parameter or the routing parameter. The child
document ends up being assigned to the same shard as the parent, so getting
it requires knowledge of the parent id to properly route it.
On Wed, May 16, 2012 at 4:48 PM, Yuriy Bondaruk email@example.com wrote:
I have a problem with getting a child document by it's id. I send GET
request 'localhost:9200/test-index/ChildItem/41311aa0' and the
response says that item with the specified id doesn't exist. If use
_search query then the document is returning as expected.
But if I don't use parent/child configuration for ChildItem document
then GET operation works well.
Why ES doesn't return document by it's id when the parent/child
configuration is using? Or should I change GET request somehow?
Here is mapping of the child and parent: