-
Notifications
You must be signed in to change notification settings - Fork 210
docs.rs search is ordered randomly for non-exact matches #489
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
Comments
I'm not sure that is the problem. If you do the exact same search, and hit refresh the results change. |
I came up with a SQL query that works but is kind of complicated: WITH valid_releases AS (
SELECT *
FROM releases INNER JOIN crates ON releases.crate_id = crates.id
WHERE yanked = false AND rustdoc_status = true AND name LIKE '%regex%'
), ordering AS (
SELECT ROW_NUMBER() OVER (
PARTITION BY name
ORDER BY
name = 'regex' DESC,
MAX(version) > '1.0', -- TODO: semver in SQL ??
SUM(downloads) DESC,
name
) as row,
name, MAX(version) as version,
SUM(downloads) as downloads
FROM valid_releases
GROUP BY name
ORDER BY
name = 'regex' DESC,
MAX(version) > '1.0', -- TODO: semver in SQL ??
SUM(downloads) DESC,
name
LIMIT 10
) SELECT ordering.*, release_time -- , description, github_stars
FROM releases INNER JOIN crates ON releases.crate_id = crates.id
INNER JOIN ordering
ON releases.version = ordering.version AND crates.name = ordering.name
ORDER BY ordering.row ASC; |
BTW this is also partially cause by using |
The new behavior for
The new behavior for
|
Uh oh!
There was an error while loading. Please reload this page.
Search for Tokio and tokio cames out completely different result
tokio first result:
tokio-0.2.0-alpha.6
Tokio first result:
new-tokio-smtp-0.8.1
, and DO NOT havetokio-0.2.0-alpha.6
at allfutures first result:
futures-0.3.1
Futures first result:
futures_future-0.1.1
, andfutures-0.3.1
is fifth resultI don't think this is the behavior a search engine should be.
P.S.: I found this when I was in bed, using my phone to search tokio doc, and my keyboard auto capitalized first character of tokio
The text was updated successfully, but these errors were encountered: