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?
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 bondyk@gmail.com wrote:
Hi,
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?
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)?
Can I use GET request with specified parent-id + child-id or only POST
search?
On Wed, May 16, 2012 at 10:49 PM, Shay Banon kimchy@gmail.com 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 bondyk@gmail.com wrote:
Hi,
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?
On Wed, May 16, 2012 at 11:14 PM, Юрій Іванович Бондарук bondyk@gmail.comwrote:
Hi,
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
instead.
Can I use GET request with specified parent-id + child-id or only POST
search?
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 kimchy@gmail.com 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 bondyk@gmail.com wrote:
Hi,
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?
On Thu, May 17, 2012 at 1:25 AM, Shay Banon kimchy@gmail.com wrote:
On Wed, May 16, 2012 at 11:14 PM, Юрій Іванович Бондарук <bondyk@gmail.com
wrote:
Hi,
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
instead.
Can I use GET request with specified parent-id + child-id or only POST
search?
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 kimchy@gmail.com 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 bondyk@gmail.comwrote:
Hi,
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?
On Thu, May 17, 2012 at 1:25 AM, Shay Banon kimchy@gmail.com wrote:
On Wed, May 16, 2012 at 11:14 PM, Юрій Іванович Бондарук < bondyk@gmail.com> wrote:
Hi,
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
instead.
Can I use GET request with specified parent-id + child-id or only
POST search?
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 kimchy@gmail.com 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 bondyk@gmail.comwrote:
Hi,
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.