-
Notifications
You must be signed in to change notification settings - Fork 636
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
Searching for "any" can't find "mopa" crate. #1407
Comments
This is the behavior of PostgreSQL full text search, which we have very little control over. I believe in this case, "any" is a stop word.
|
Shall there be a policy about valid keywords in Cargo.toml? Maybe What keyword should be used in relation to std::any::Any? Literally Also crates.io should show some dedicated message for invalid search requests, not just "nothing found". |
Perhaps we should modify the query to check whether any of the keywords exactly match the search text. |
Anyway, if there are no search results due to search query being too short (or something), some special message should be shown, like "Too many results to display. Please narrow your search query". |
This isn't about it being too short, it's about it only containing stop words. Unfortunately, PG gives us no way to actually detect whether a full text search query is ignored or not. |
As a workaround, the list of words may be just copied from PG. Pseudocode: let number_of_search_results : usize;
let search_query : Set<String>;
let list_of_known_stopwords: Set<String>;
let message = if search_query.len() == 0 {
"Search query is empty"
} else if search_query - list_of_known_stopwords == empty_set {
"Search query contains only stopwords"
} else if number_of_search_results == 0 {
if search_query & list_of_known_stopwords != empty_set {
"Nothing found. Note that following stopwords are ignored:" + (search_query & list_of_known_stopwords)
} else {
"Nothing found"
}
} else {
"Results:"
} |
Can't we change PostgreSQL's dictionary like https://stackoverflow.com/a/2227235? |
I threw some ideas about a possible solution on zulip. |
mopa's Cargo.toml:
Yet when I search for "any" in crates.io, I get "0 crates found. Get started and create your own.".
The text was updated successfully, but these errors were encountered: