-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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(v2): contextual search, dynamic Algolia facetFilters #3550
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for docusaurus-2 ready! Built with commit c4abd5d |
…eta tags and facet filters
slorber
added
the
pr: breaking change
Existing sites may not build successfully in the new version. Description contains more details.
label
Oct 14, 2020
slorber
changed the title
feat(v2): contextual search
feat(v2): contextual search, dynamic Algolia facetFilters
Oct 14, 2020
slorber
added a commit
to slorber/docsearch-configs
that referenced
this pull request
Oct 15, 2020
francoischalifour
pushed a commit
to algolia/docsearch-configs
that referenced
this pull request
Oct 15, 2020
Note
|
This was referenced Oct 15, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
Signed Facebook CLA
pr: breaking change
Existing sites may not build successfully in the new version. Description contains more details.
pr: new feature
This PR adds a new API or behavior.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Algolia search engine should create its filter dynamically according to the browsed page, instead of hardcoding the facetFilters in config file.
See also #3396
In practice, this allows:
Design choice: make the page tagging system decoupled from Algolia, so that maybe we could support another search engine plugin in the future ( like
docusaurus-theme-search-elastic
) or enable the community to provide its own search system, and still be able to use the contextual search feature.Enable contextual search
Documentation: https://deploy-preview-3550--docusaurus-2.netlify.app/classic/docs/search#contextual-search
The
contextualSearch
is for now opt-in, for retrocompatibility.Algolia crawler should run on your upgraded site, so you'd rather turn this on in 2 phases (ie not upgrade + contextualSearch: true in the same PR/commit). You should rather get this working locally before publishing a site with
contextualSearch: true
.If it does not work, check that the Algolia DocSearch team has added the
docusaurus_tag
value in your configattributesForFaceting
, like here: algolia/docsearch-configs#2546Note: the Algolia team should normally add this to your config automatically before the 23 October, in the meantime you can submit a PR to your own config.
Breaking change:
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview + dogfooding + tests