-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: take into account the analyzer's score.final when sorting suggestions #11
Conversation
@@ -58,10 +58,7 @@ | |||
}, | |||
"script_score": { | |||
"lang": "groovy", | |||
"script": "doc[\"package.name.raw\"].value.equals(text) ? 100000 + _score : _score", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will loose the boost on the exact matches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reasoning for this was that I believe this type of query already requires that the prefix matches? the boost on package.name.raw
was resulting in packages like requ
and asyn
bubbling up above async
and request
.
Perhaps a compromise would be making boost exact match configurable? my gut though is that just ranking on score might be good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make it configurable via boostExact
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for suggestions, exact matches are less important. If you start typing requ
you probably want to see request
sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that not doing the boost will have some undesired effects. For instance, if someone searches for request
the first recommendation should be request
, despite a module named request-handler
having a better score (this was an example). Having this behind an option would let us toggle the behavior and allow us to experiment with it. I will probably enabled the boostExact
option once this PR lands so that I keep the current behavior on https://npms.io.
This looks good! Are you getting good results? |
@satazor the results are feeling pretty good, I'm noticing that a library like |
@atduarte What do you think of this? |
@@ -58,10 +58,7 @@ | |||
}, | |||
"script_score": { | |||
"lang": "groovy", | |||
"script": "doc[\"package.name.raw\"].value.equals(text) ? 100000 + _score : _score", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make it configurable via boostExact
.
@satazor updated things so that it defaults to the old behavior, but gives us the ability to configure the exact boost match. The default behavior should be identical for you on npms.io, but released as a major just in case (since there are slight changes in scoring). |
Awesome! |
Introduces the same
analyzerWeight
andscoreWeight
toggles available when performing a similarity search.TODO:
CC: @aearly