redis-io
redis-io copied to clipboard
Add search to the commands and topics
Hello,
I started using Redis recently. I found the documentation contained a lot of very detailed pages about various topics, but as a beginner, I had a hard time navigating to quickly jump to the part I was interested in (namely, sorted sets and their methods).
It happens that I actually work on a project called DocSearch whose goal is to provide fast and relevant search to technical documentations. So I did a quick fork to add DocSearch to the Redis website. You can see how it looks and even try it live.
This PR contains the minimal code to make it work (including a CSS and JS dependency and editing some layout). I re-used the styling of the search that was already available on the command page, but made it available on all pages, and searching into both commands and topics. It searches into both the page titles and their content, display results as you type, with highlighted keywords, typo-tolerance and jumps you to the matching part of the page.
The way it works is by crawling the website every 24h, extracting content from the HTML and pushing it to Algolia's API. Then, the docsearch.js library listens to every keystroke in the searchbar and sends a search query to Algolia's API, and displays the results that are then returned in a dropdown.
Let me know if this is something you'd be interested in adding, I'd by happy to clarify any question you might have, fix any issue, and/or clean up the PR to get this merged.
Hey, @antirez congrats on the 5.0 release. I updated the PR and search results with the updated content.
Let me know if this site-wide search is something you'd be interested in. I'd be happy to help integrate it in the real website.
Cheers,
:wave: @antirez
Happy to help in any way to enhance the search. Cheers
