Skip to content
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

Merged
merged 4 commits into from
Nov 9, 2017

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Oct 18, 2017

Introduces the same analyzerWeight and scoreWeight toggles available when performing a similarity search.

TODO:

  • update docs.

CC: @aearly

@bcoe bcoe requested a review from satazor October 18, 2017 22:40
@coveralls
Copy link

coveralls commented Oct 18, 2017

Coverage Status

Coverage increased (+0.005%) to 99.315% when pulling d1c2d72 on typeahead-quality into 51b1bc6 on master.

@npms-io npms-io deleted a comment from coveralls Oct 18, 2017
@@ -58,10 +58,7 @@
},
"script_score": {
"lang": "groovy",
"script": "doc[\"package.name.raw\"].value.equals(text) ? 100000 + _score : _score",
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link

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.

Copy link
Member

@satazor satazor Oct 30, 2017

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.

@satazor
Copy link
Member

satazor commented Oct 21, 2017

This looks good! Are you getting good results?

@bcoe
Copy link
Contributor Author

bcoe commented Oct 21, 2017

@satazor the results are feeling pretty good, I'm noticing that a library like gulp or async tends to be in the top-three of typeahead results.

@satazor
Copy link
Member

satazor commented Oct 21, 2017

@atduarte What do you think of this?

@bcoe
Copy link
Contributor Author

bcoe commented Oct 24, 2017

@satazor @atduarte bump :) @aearly is close to rolling this out.

@@ -58,10 +58,7 @@
},
"script_score": {
"lang": "groovy",
"script": "doc[\"package.name.raw\"].value.equals(text) ? 100000 + _score : _score",
Copy link
Member

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.

@coveralls
Copy link

coveralls commented Nov 9, 2017

Coverage Status

Coverage increased (+0.005%) to 99.315% when pulling c37167d on typeahead-quality into 51b1bc6 on master.

@bcoe bcoe merged commit c8b1297 into master Nov 9, 2017
@bcoe bcoe deleted the typeahead-quality branch November 9, 2017 00:24
@bcoe
Copy link
Contributor Author

bcoe commented Nov 9, 2017

@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).

@satazor
Copy link
Member

satazor commented Nov 9, 2017

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants