-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Contextual doc version search (Algolia/DocSearch) #3396
Comments
Is this related to V2? I'm currently using V1 and it works the way you explained it should. Whichever version of documents I am on, the search results are from that version only. |
@amimas according to what I see, yes contextual search works on v1, but not on v2. I see this code on v1 responsible for contextual doc search: For v2 we'll need something similar, but also take into account docs multi-instance, and maybe it's worth to add the possibility to search non-docs things (blog posts, pages), as it seems currently unsupported on v1. |
Important to consider: if we persist a "preferred version" we probably should search in this version when searching on unversioned pages (see also #3543) |
Not sure what is "docs multi-instance" @slorber . |
Thanks for the reference @slorber . Sounds like a neat feature. I am actually doing something like this using V1 already. I have separate Docusaurus V1 instances for different tools and they are all deployed at subfolder from the root of the domain. Each docusaurus instance has its own versioning and search index with algolia. As a result, when you are in a page doing a search, the search is already contextual based on the tool and the version being viewed. A landing page at the root is deployed using another generator that brings the whole site together. Anyways, if we have "multi-instance" docs in V2, then yes, that should be in the consideration of contextual search. |
Great, hope we'll be able to solve your usecase. There's already a PR here: #3543, but waiting for Algolia inputs to complete it. |
🚀 Feature
A site can be versioned. In such case it's likely we want to use an Algolia DocSearch facet filter so that we don't end up with duplicate results:
This works, but also has some drawbacks: if you are currently browsing v1, and last version is v2, when you search, you will find v2 results.
We should make this facetting behavior contextual/dynamic, instead of being hardcoded in the site config, and if user is currently browsing v1, we should facet on v1, show him v1 related results.
Note: the solution must play well with docs multi-instance support. If you have:
What should happen if:
The text was updated successfully, but these errors were encountered: