-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToParentBlockJoinQuery's explain should depend on its ScoreMode #12204
Comments
@mkhludnev do you have ideas on how we should best solve this one? I think there are many paths we could take but open to the guidance from committers watching the issue. |
@MarcusSorealheis, Well.. I don't have an elegant solution in mind, beside of almost fully copying score logic into explain or some crazy hairy polimorphish. Probably, somewhat constructive approach would be: collect all matching children explains, then either put only one which score matches parent one (handling min,max) or put all children explain otherwise (handling sum,avg). |
I think both of those options make sense. I think polymorphism would be pretty elegant, but copying the score logic scares me a bit. I'll think about about these and other options. There's quite a lot of work in this area in general, so I also need to weigh that fact against completing this task. |
Are users asking for If a document is returned as a top doc in any scored query, the reason it was returned is almost because it was the highest scoring document. In the case of a differing score mode this query, it was the biggest contributor to the relevance scoring document of the child docs. Isn't it most meaningful? I worry somewhat about investing even a little time into |
Sure. Sum/total is definitely one of useful options. There might all variety of them. There might be a function query or field value in the child query. eg we can |
@mkhludnev and @kashkambath I put up a PR. I took a pretty basic approach. Computing the score based on score mode is pretty straightforward. |
I made it a draft, though, because there's still a lot of work to do. After two hours, I haven't figured it out, but I am on the right path. There's a lot more to it. |
@mkhludnev or @kashkambath I'm almost done with the PR but there are a few problems:
Some details about this query seem and aligning on the behavior/requirements would be helpful before I go further. After digging in a couple times over the past week, I have some rough idea about how we could make things work, but I am curious about how they should work. I don't have strong opinions other than the fact that this work is important. Explain is very useful for debugging. |
|
@mkhludnev, @kashkambath, et. al this issue can be closed as the PR has been merged and backported to |
should be at 9.7 |
Description
Currently,
ToParentBlockJoinQuery
's explain() returns the explanation for the highest-scoring child document, regardless of the ScoreMode. If theScoreMode
isScoreMode.Max
, this makes sense. However, for otherScoreMode
s (Min
,Avg
,Total
), this output is not as helpful for the user. We should make the explain output forToParentBlockJoinQuery
depend on theScoreMode
used in the query.The text was updated successfully, but these errors were encountered: