-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: Improved the Native Search Algorithm #1557
Conversation
* Improved the Native Search Algorithm You can now search tags in addition to H2 and H3 titles as well as the search can now take in multiple words separated by a space. * Took out a console.log * Reflected changes to the SearchBox in the doc
This is very helpful. I hope it will get merged soon |
+1 for this. |
Great work, but could you write full tests for it before I decide to approve it? |
Pardon my ignorance but I am not really sure how to write full tests for this... could you point me to another test in the repo, that would be helpful in seeing what I need to write up. Thank you. @ulivz |
If someone could point me to an example on how to write a test for this, I'd happily do it! @ulivz |
It has been a while since you create the pr ! I will have a look about create tests needed @ynnelson thank's for your work |
@ynnelson What you need to do is setup a vue test environment in the VuePress |
Any progress on this feature? |
Can someone merge please? |
I resolved the conflict, not sure about how to solve the 1 check that failed. |
@ynnelson there seems to be some linting issues on The other check for "Semantic Pull Request" seems to be due to the title. |
@ynnelson you could also give me write access to your branch and I'll make the required changes. |
@kyle-tightest I added you as a collaborator. |
@ynnelson thanks. Can you please change this pull request's title to |
This is ready to be merged i think. |
@f3ltron |
Hey guys this is very relevant, when will this be merged? Cheers! |
i am gonna ask to them if they can put it for the next release |
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 a fantastic update. Thank you for doing this!
Hey @ynnelson! As @ulivz said I still think there would be value in testing this. This way, we can fully validate the behavior on our end, and improve the algorithm later on without breaking expectations. If you extract the logic outside of the component, this should be easy to test. I'm available to help you if you need. |
I just added some tests. One more review and it will be ready to be merged 🎉 |
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.
Looks great!
Summary
You can now search tags in addition to H2 and H3 titles as well as the search can now take in multiple words separated by a space.
What kind of change does this PR introduce? (check at least one)
I simply improved the
suggestions ()
method in the SearchBox component to now include tags if they exist in the frontmatter, this is combined with the existing behavior of searching through headers. Also, the other improvement is that you can now do a search based on multiple keywords as opposed to only one previously.This is a very minor adjustment which I think will satisfy a lot of the issues with the native search and allows the user to make pages show up in the search based on the tags assigned to it.
The only change to the UI was to make the suggestion box search sit
0.5 rem
lower on the navbar.Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information: