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

Display feedback about any filters have been applied during a search #1228

Closed
daveverwer opened this issue Jul 12, 2021 · 2 comments · Fixed by #1401
Closed

Display feedback about any filters have been applied during a search #1228

daveverwer opened this issue Jul 12, 2021 · 2 comments · Fixed by #1401

Comments

@daveverwer
Copy link
Member

To enable better debugging of filtered search, and a better explanation of what happened for people searching we need to describe what the results are in a better way.

Currently, above the search results, it shows this:

Screenshot 2021-07-12 at 09 11 08@2x

We should break down what's being searched for and display a readable explanation of it. Something along the lines of this:

Results for “test” where [Last commit date] [is >] [2021-01-01], [Number of stars] [is >] [500], and [Platform] [is compatible with] [iOS and macOS]

We should use styling to separate the different bits of that sentence surrounded by square brackets, so make sure each clause is wrapped in a span. I can help with the styling when it comes to that.

We could either display this in a sentence format or as a set of rows below the results line. Something along the lines of this:

Swift Package Index - 2021-07-12 09 26 06

If there is no actual search term, it should say "Results for all packages" where ...

@Sherlouk
Copy link
Sponsor Collaborator

100% agreed, and this is something I tried to capture in my original PR by "Update the search results page to show the filters separate to the search terms". This is very much needed but I didn't want to inflate what was already there.

I think the steps here would be to add something like this to the search results response object:

{
  query: {
    term: "dave is bored of reviewing james' code",
    filters: [
      { key: "updated", operator: "exact", value: "2020-01-01" }, // object style - OR -
      { key: "Last commit date", operator: "=", value: "2020-01-01" }, // object view model style - OR -
      "Last commit date on exactly 2020-01-01" // full view model style
    ]
  }
}

As to the displaying of this data, I prefer the second (rows) idea you have above.

@daveverwer
Copy link
Member Author

As to the displaying of this data, I prefer the second (rows) idea you have above.

Me too

@Sherlouk Sherlouk moved this from To do to In progress in Search Enhancements Nov 26, 2021
@daveverwer daveverwer moved this from In progress to Done in Search Enhancements Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants