Nested has_parent query

I have the exact same problem as the one previously posted
https://groups.google.com/forum/?fromgroups=#!searchin/elasticsearch/has_parent/elasticsearch/TwqHqOigVJs/FBba9p1ZFc0J

Except that instead of has_child i am trying to do a has_parent query.

curl -XPOST http://localhost:9200/my_index/grandchild/_search/ -d '{
"query": {
"has_parent": {
"parent_type": "child",
"query": {
"has_parent": {
"parent_type": "parent",
"query": {
"match_all": {}
}
}
}
}
}
}'
For which i get a empty result.

I have defined routing for grandchild docs and the nested has_child works
fine too. Any ideas what i may be doing wrong here?

Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Kul,

Is there any chance you could post a complete example of your problem
including the mapping ?

Michael

On Monday, April 1, 2013 1:00:41 PM UTC+2, kul wrote:

I have the exact same problem as the one previously posted
Redirecting to Google Groups

Except that instead of has_child i am trying to do a has_parent query.

curl -XPOST http://localhost:9200/my_index/grandchild/_search/ -d '{
"query": {
"has_parent": {
"parent_type": "child",
"query": {
"has_parent": {
"parent_type": "parent",
"query": {
"match_all": {}
}
}
}
}
}
}'
For which i get a empty result.

I have defined routing for grandchild docs and the nested has_child works
fine too. Any ideas what i may be doing wrong here?

Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Michael,

Thanks for asking. But it seems i had done some mistake with the data while
testing, Nested queries work very nicely already.

Thanks

On Monday, April 1, 2013 11:46:04 PM UTC+5:30, mkleen wrote:

Hi Kul,

Is there any chance you could post a complete example of your problem
including the mapping ?

Michael

On Monday, April 1, 2013 1:00:41 PM UTC+2, kul wrote:

I have the exact same problem as the one previously posted
Redirecting to Google Groups

Except that instead of has_child i am trying to do a has_parent query.

curl -XPOST http://localhost:9200/my_index/grandchild/_search/ -d '{
"query": {
"has_parent": {
"parent_type": "child",
"query": {
"has_parent": {
"parent_type": "parent",
"query": {
"match_all": {}
}
}
}
}
}
}'
For which i get a empty result.

I have defined routing for grandchild docs and the nested has_child works
fine too. Any ideas what i may be doing wrong here?

Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.