Top_children trouble with multi-shard index

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?

Can you try and create a simple recreation of the problem, and then we can
have a look at it (see Elasticsearch Platform — Find real-time answers at scale | Elastic).

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?

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 Elasticsearch Platform — Find real-time answers at scale | Elastic).

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?