Top_children not returning results

I am having an issue with the top_children query sporadically not
returning any results on 0.19.2. I have created a gist and linked it
below. I tried debugging the code - I can't say I really understand
what's going on but it looks like in QueryPhase.execute() the while
loop executes twice due to a lack of results. After the first
iteration, the parent doc is set in the context. Somehow during the
second iteration, the result doc is actually the parent (I checked the
doc id by using luke on the index) and the parentDocs map in the
context map is empty because TopChildrenQuery.processResults recreates
it on every call. Hopefully that makes sense and is helpful. :slight_smile:

I went ahead and opened a new issue:

On Saturday, April 14, 2012 2:36:59 AM UTC-4, slushi wrote:

I am having an issue with the top_children query sporadically not
returning any results on 0.19.2. I have created a gist and linked it
below. I tried debugging the code - I can't say I really understand
what's going on but it looks like in QueryPhase.execute() the while
loop executes twice due to a lack of results. After the first
iteration, the parent doc is set in the context. Somehow during the
second iteration, the result doc is actually the parent (I checked the
doc id by using luke on the index) and the parentDocs map in the
context map is empty because TopChildrenQuery.processResults recreates
it on every call. Hopefully that makes sense and is helpful. :slight_smile:

elastic search bug when running top_children queries · GitHub