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

Allow multiple keywords in crate search #1543

Merged
merged 5 commits into from
Jan 4, 2020

Commits on Nov 2, 2019

  1. Allow multiple keywords in crate search

    This commit allows multiple `keyword=` parameters in the querystring to
    enable searching for all crates under the specified keywords
    
    Towards rust-lang#1461
    Paul Woolcock authored and carols10cents committed Nov 2, 2019
    Configuration menu
    Copy the full SHA
    638cdb1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    97d15ea View commit details
    Browse the repository at this point in the history
  3. Add a working "matches all keywords" query.

    Diesel has a bug where array expression methods aren't implemented on
    nullable expressions, so we can't just call Diesel's `.contains` method
    until the fix lands. I've added a workaround for the time being. This
    results in a runtime error since `keyword` was defined as `varchar`,
    which coerces to `text`, but arrays do not. I've changed the column type
    to address this. The keywords table is small enough and read
    infrequently enough that I'm not concerned about the exclusive lock in
    this migration.
    sgrif authored and carols10cents committed Nov 2, 2019
    Configuration menu
    Copy the full SHA
    8f53666 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    547339a View commit details
    Browse the repository at this point in the history
  5. Add an all_keywords parameter to the search route

    Pass along any specified value for the all_keywords parameter to the
    API request to search crates.
    
    This lets us manually construct URLs in the browser like:
    
    - /search?all_keywords=foo+bar
    - /search?all_keywords=foo+bar&q=test
    
    but there is no form field in the search form as yet; eventually, we'll
    need an "advanced search" form or similar.
    carols10cents committed Nov 2, 2019
    Configuration menu
    Copy the full SHA
    9a3485b View commit details
    Browse the repository at this point in the history