-
Notifications
You must be signed in to change notification settings - Fork 118
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
Make searches case-aware, and prefer case-exact matches (even in dependent packages) to case-inexact matches #3636
Comments
This is a weird one. I also notice that the |
Why should |
It's not that it's not the top result, it's that it doesn't appear in the list at all, as far as I can see. |
Given how much it is used in the framework, it does seem like it should be on the first page of results at least, even if it's not the top result. |
Correct, we only display the top 10 results, and there are at least 10 results in package:flutter. Pressing enter gets you the full results.
If you can think of a generic criteria that would put it above elements in package:flutter, I can implement it. |
Ahh, OK. so it's not in the top ten results, but it does appear in the overall results if you hit enter, I see that now. |
We don't have any metric of how "important" or how "used" an element is, and I think that would be a great improvement. Two metrics come to mind:
So if we wanted to implemente such a system, it would just take some time, and need to be staffed and prioritized and staffed. |
And staffed. :-) |
Oh wow, I had no idea it did appear in the actual results. It's so buried. I really expected it to be the top result. If I search for |
The search prioritizes results from dependency packages depending on the We could add a syntax like |
You know, I wonder if just making it more case sensitive would help. I expect to see "Duration" if I type "Duration", but if I type "duration" I might expect to see either. |
I think it's also weird that if I type |
This is intentional and important. If a search ( It sounds like the cause of a lot of surprises is the 10-element limit. We could increase that, or make it a scrollable space that takes up the height of 10 elements. |
Well that's fine but |
|
Make the search case-aware, and score case-exact matches higher than case-inexact ones. |
I guess another way would be to score class matches higher than member matches. I would rarely, if ever, type "duration" and expect to get Indeed by that reasoning I'd probably expect to see |
Duration
class
+1 to Hixie's last comment, classes should sort higher than members. I pointed out a similar problem in flutter/website#10369. I swear this used to work and is a recent regression. The search code looks like it is trying to do this: Lines 75 to 79 in f339b09
|
I think this is P1, not P3. This is by far the biggest problem I run into when using our docs now. It's literally causing documentation to be hidden. I just tried to look up the |
STEPS TO REPRODUCE
/
.Duration
.EXPECTED RESULTS
The Duration class should be the top result after step 3 and in the complete list after step 4.
ACTUAL RESULTS
Duration
doesn't appear anywhere.The
Duration
class is in the API docs though: https://main-api.flutter.dev/flutter/dart-core/Duration-class.htmlThe text was updated successfully, but these errors were encountered: