Top_children trouble with multi-shard index


(slushi) #1

I am using the top_children query and it was working fine in my dev
environment, but I am having trouble getting it to work in our test
environment. After some debugging I found that the key difference is that
the test env has multiple shards while my dev env only has 1 shard. This
leads me to believe there is some issue with routing, but I checked the
parent/child mapping as well as a problematic child document and they both
seem ok (parent field is set in both places). I also verified that doing
the child query returns the correct child documents. Any ideas on what else
I can do to debug this problem?


(Shay Banon) #2

Can you try and create a simple recreation of the problem, and then we can
have a look at it (see http://www.elasticsearch.org/help).

On Tue, May 29, 2012 at 5:01 PM, slushi kireetreddy@gmail.com wrote:

I am using the top_children query and it was working fine in my dev
environment, but I am having trouble getting it to work in our test
environment. After some debugging I found that the key difference is that
the test env has multiple shards while my dev env only has 1 shard. This
leads me to believe there is some issue with routing, but I checked the
parent/child mapping as well as a problematic child document and they both
seem ok (parent field is set in both places). I also verified that doing
the child query returns the correct child documents. Any ideas on what else
I can do to debug this problem?


(slushi) #3

Thanks for the reply. I was actually initially unable to repro using curl,
the query returned hits as expected. I found that in my java code I create
the SearchRequestBuilder I had a line like:

builder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).

If I comment that line, the java code also returned results. I tried for a
bit to try to create a simplified test case but I couldn't figure out the
exact scenario that causes the bug, I never get results with my full data
set but always get results when trying to produce a small gist.

On Wednesday, May 30, 2012 4:44:39 AM UTC-4, kimchy wrote:

Can you try and create a simple recreation of the problem, and then we can
have a look at it (see http://www.elasticsearch.org/help).

On Tue, May 29, 2012 at 5:01 PM, slushi kireetreddy@gmail.com wrote:

I am using the top_children query and it was working fine in my dev
environment, but I am having trouble getting it to work in our test
environment. After some debugging I found that the key difference is that
the test env has multiple shards while my dev env only has 1 shard. This
leads me to believe there is some issue with routing, but I checked the
parent/child mapping as well as a problematic child document and they both
seem ok (parent field is set in both places). I also verified that doing
the child query returns the correct child documents. Any ideas on what else
I can do to debug this problem?


(system) #4