Skip to content
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(search): enable contextual search by default #6407

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jan 19, 2022

Breaking changes

  • Default value change that might impact your site's search behavior, use contextualSearch: false to revert to previous behavior

Motivation

Contextual Search has been widely used and makes sense for most sites

We can now safely turn this on by default (it has always been the long-term goal).

Fixes issues reported on versioned and i18n sites not enabling it. For example #5880

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

dogfood

@slorber slorber added pr: new feature This PR adds a new API or behavior. pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. labels Jan 19, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 19, 2022
@slorber slorber linked an issue Jan 19, 2022 that may be closed by this pull request
2 tasks
@slorber slorber removed a link to an issue Jan 19, 2022
2 tasks
@netlify
Copy link

netlify bot commented Jan 19, 2022

✔️ [V2]

🔨 Explore the source changes: 2299bcb

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61e8436bcc022f000891f04e

😎 Browse the preview: https://deploy-preview-6407--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 67
🟢 Accessibility 98
🟢 Best practices 93
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6407--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: 0 B

Total Size: 680 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 43.5 kB
website/build/assets/css/styles.********.css 103 kB
website/build/assets/js/main.********.js 504 kB
website/build/index.html 29.6 kB

compressed-size-action

@slorber slorber changed the title feat: enable contextual search by default feat(search): enable contextual search by default Jan 19, 2022
@slorber slorber removed the pr: new feature This PR adds a new API or behavior. label Jan 19, 2022
@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Jan 20, 2022
@Josh-Cena Josh-Cena linked an issue Jan 25, 2022 that may be closed by this pull request
7 tasks
@Josh-Cena Josh-Cena merged commit dd539dd into main Jan 25, 2022
@Josh-Cena Josh-Cena deleted the slorber/enable-contextualSearch-by-default branch January 25, 2022 03:45
@hasezoey
Copy link

hasezoey commented Feb 6, 2022

from my testing, our site's search kinda broke after the update (not displaying anything when searching), so we had to set contextualSearch: false, our site does not use languages or versioning yet

@slorber
Copy link
Collaborator Author

slorber commented Feb 9, 2022

You may have a bad/outdated index crawling config, and it only works without contextual search.

If you want versioning/i18n later, you'd rather update that config

@hasezoey
Copy link

hasezoey commented Feb 9, 2022

You may have a bad/outdated index crawling config, and it only works without contextual search.

i literally had updated that config to what the example at Docusaurus v2 template showed ~15 days ago (because of the algolia migration, where the old config (automatic config) didnt work anymore), so i dont think i am using a too much outdated config (also, i dont modify that config myself, because i dont really understand all the options and the default work fine)

@slorber
Copy link
Collaborator Author

slorber commented Feb 9, 2022

@hasezoey then there might be another unexpected problem.

If you deploy your site on a preview branch with contextual search enabled, we could inspect it more easily and see what is wrong

@hasezoey
Copy link

hasezoey commented Feb 9, 2022

If you deploy your site on a preview branch with contextual search enabled, we could inspect it more easily and see what is wrong

deploy as in visitable from the web or deployed as in commits?

when its commits, i have it still have the old commits

Commits:

(can also be reproduced from local deployment, when contextual search is disabled, local search works, if enabled it does not)

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: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Algolia includes result from different locales but redirecting shows 404
4 participants