-
Notifications
You must be signed in to change notification settings - Fork 428
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: simplify search strategy configuration #7765
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
d221034
to
bd8c0b7
Compare
search.enableLegacySearch
option to clearer and more flexible search.strategy
optionbd8c0b7
to
3341b00
Compare
3341b00
to
ff1dd50
Compare
No changes to documentation |
Component Testing Report Updated Nov 7, 2024 4:11 PM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Thu, 07 Nov 2024 16:14:00 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
ff1dd50
to
15f018e
Compare
a224c66
to
bf7e1a2
Compare
The search strategy was previously selected using the `search.enableLegacySearch` boolean, which became confusing after we reverted the default behaviour. Developers had to explicitly set `search.enableLegacySearch` to `false` in order to enable the Text Search API strategy. This change deprecates `search.enableLegacySearch` in favour of the `search.strategy` union, which is clearer and more flexible. The current options are: - `"groqLegacy"`: Legacy search strategy (the current default). - `"textSearch"`: Search using the Text Search API. In the near future, we will add a new option, allowing developers to test the new GROQ search strategy. If the project already sets `search.enableLegacySearch` to `false`, this will automatically be mapped to the `"textSearch"` strategy. If the project uses both `search.enableLegacySearch` and `search.strategy`, `search.strategy` will take precedence.
bf7e1a2
to
d1f7b5b
Compare
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 looks good to me, thanks for adding the tests describing all the scenarios, it makes it very simple to review.
* next: fix(deps): upgrade `@sanity/ui` to `2.8.22` (#7783) fix(deps): Update dev-non-major (#7770) fix(deps): update dependency @portabletext/editor to ^1.6.1 (#7778) fix(deps): update dependency @sanity/presentation to v1.17.10 (#7767) fix(deps): update dependency @sanity/mutate to ^0.10.2 (#7781) fix(deps): update dependency @sanity/ui to ^2.8.21 (#7779) fix(deps): update dependency @sanity/client to ^6.22.3 (#7766) feat: simplify search strategy configuration (#7765) chore: update Studio teams in CODEOWNERS (#7780) chore(deps): update typescript-tooling (#7762) fix(deps): update dependency @portabletext/editor to ^1.5.5 (#7763) fix(deps): update dependency react-rx to ^4.1.4 (#7768) chore(deps): lock file maintenance (#7757)
Description
The search strategy was previously selected using the
search.enableLegacySearch
boolean, which became confusing after we reverted the default behaviour. Developers had to explicitly setsearch.enableLegacySearch
tofalse
in order to enable the Text Search API strategy.This change deprecates
search.enableLegacySearch
in favour of thesearch.strategy
union, which is clearer and more flexible.The current options are:
"groqLegacy"
: Legacy search strategy (the current default)."textSearch"
: Search using the Text Search API.In the near future, we will add a new option, allowing developers to test the new GROQ search strategy.
If the project already sets
search.enableLegacySearch
tofalse
, this will automatically be mapped to the"textSearch"
strategy. If the project uses bothsearch.enableLegacySearch
andsearch.strategy
,search.strategy
will take precedence.What to review
search.enableLegacySearch
configuration option?"groqLegacy"
and"textSearch"
?Testing
search.enableLegacySearch
tofalse
automatically setssearch.strategy
to"textSearch"
.search.enableLegacySearch
totrue
automatically setssearch.strategy
to"groqLegacy"
.search.enableLegacySearch
andsearch.strategy
,search.strategy
takes precedence."groqLegacy"
, searches result in HTTP requests todata/query
."textSearch"
, searches result in HTTP requests todata/textsearch
.Notes for release
If you aren't using the Text Search API in your Studio—or don't know what it is—you can ignore this.
The
search.enableLegacySearch
configuration option has been deprecated and will be removed in a future release. You can still setsearch.enableLegacySearch
tofalse
to enable the Text Search API in your Studio for now, but we encourage you to instead setsearch.strategy
to"textSearch"
. We've made this change so that it's easier to test different search strategies in the future.Sanity config (
sanity.config.ts/js
) migration