Sorting by relevance in matching children - top_children and has_child

We've been using the has_child query extensively and understand that its an
extension of the has_child filter (no scoring), while I understand the
top_children query does translate the scoring (so parent docs are ranked
according to child docs relevance).

I like to know in detail how top_children plays out if we have additional
criteria on the parents document, and multiple top_children criteria, e.g.
parent doc type [user] has children doc types [tweet] and [status_update]

so I like to query for users who are not deleted, have a tweet containing
"bored" and a status_update containing "school". Right now I have:

[user] field "deleted" matches "no"
AND has_child [tweet] contains "bored"
AND has_child [status_update] contains "school"

which is working but this does not rank the user matches in terms of how
well "bored" is matched in [tweet] and "school" is matched in
[status_update]
Is top_children a suitable replacement in this case?

[user] field "deleted" matches "no"
AND top_children [tweet] contains "bored"
AND top_children [status_update] contains "school"

Generally can I run the query with has_child once to get the "correct" total
count, and then run it again with top_children to get the "correct" ranking?
It seems like a roundabout way - is there a easier way for this?

Thanks!

Hi,

Just an update if anyone can help me on my query about trying to put
relevance from a child query into a parent one. Thanks!

We've been using the has_child query extensively and understand that its an
extension of the has_child filter (no scoring), while I understand the
top_children query does translate the scoring (so parent docs are ranked
according to child docs relevance).

I like to know in detail how top_children plays out if we have additional
criteria on the parents document, and multiple top_children criteria, e.g.
parent doc type [user] has children doc types [tweet] and [status_update]

so I like to query for users who are not deleted, have a tweet containing
"bored" and a status_update containing "school". Right now I have:

[user] field "deleted" matches "no"
AND has_child [tweet] contains "bored"
AND has_child [status_update] contains "school"

which is working but this does not rank the user matches in terms of how
well "bored" is matched in [tweet] and "school" is matched in
[status_update]
Is top_children a suitable replacement in this case?

[user] field "deleted" matches "no"
AND top_children [tweet] contains "bored"
AND top_children [status_update] contains "school"

Generally can I run the query with has_child once to get the "correct" total
count, and then run it again with top_children to get the "correct" ranking?
It seems like a roundabout way - is there a easier way for this?

Thanks!