-
Notifications
You must be signed in to change notification settings - Fork 79
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
Added Name, Description, Column, and SQL filters to search function #108
Added Name, Description, Column, and SQL filters to search function #108
Conversation
e7d0862
to
3c74c58
Compare
Just finished adding another component to this feature (shortening the description and SQL text in the search results), and it should now be ready for review. |
This is really cool! Thanks for the contribution @stephen8chang @Matt343, and sorry for the delay in following up. I'm grateful for the thought you've now put into several issues and PRs around improving the docs search functionality. In playing around with the UX, I find that I want a more flexible system. I think we'd get more mileage out of a text-based search syntax that allows users to specify which property they want to match, along the lines of the issue filtering that GitHub and Gitlab support. That could enable us to build out future filters for all sorts of things: A lot of the underlying work in this PR would still apply, but instead of checking boxes, I see users typing That said, I'm open to hearing if you feel strongly that a UI-first approach is better here. If you propose sticking to a checkbox-based approach, I have one requested change around design: Could we move the checkboxes to appear below the search bar, and only when the search is focused? I'm imagining: Lastly, there are a few behaviors that make sense, but which may be counterintuitive for users. They're not things we should resolve in this PR; if anything, we need to make separate plans for rationalizing how we search + display information for different resources in the docs site.
Both of these are true today—more subtly so, because we don't have named filters. |
@jtcohen6 Thanks for the feedback. As far as the text-based search filter idea goes, I agree that it is a more flexible filter system. However, that will require a whole reworking of this PR, so we would probably make another PR for it; if it's okay with you, I'd like to continue the checkbox filtering system. On another point, on the topic of moving the checkboxes to below the search bar, there might be a few issues there, mainly due to the fact that the existing Lastly, in regards to the last two points, those will definitely be acknowledged in future PR's, should we issue any more. |
Good by me! I still think this is a great addition, and it's gotten me thinking about the longer-term directions we could head. Thanks for humoring my Sunday afternoon armchair reflection.
How plausible do you think this would be? From a code-org standpoint, I'd feel good about moving more search logic into Last thing: Given that tags are also a highly-weighted input in #113, what do you think about including a Tags checkbox for this go-round? |
Very possible! I definitely agree that most of the search logic should be in
This is also very possible! I'll add that alongside the other changes above. Let me know what you think. @jtcohen6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Good to go from my end as soon as the merge conflicts are resolved.
There may be small things we'll want to add—explainer text, checkbox styling—but those can come later on.
Problem
Currently, the DBT docs search function searches for any instance of a search query that is located in the database, leading to unnecessarily large results pages when searching. Most of the time, users would like the ability to search by a specific criteria, such as the name or description of a node page.
Solution
To allow for more specific search results, this PR adds four new filters that works with the search function: name, description, column, and SQL. Users are now able to narrow down the search results based on their search query and the respective filter they choose.
To accomplish this, the following changes were made :
filterResults
function that takes the current search query and checkboxes clicked to filtered resultsOther Information