-
Notifications
You must be signed in to change notification settings - Fork 432
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(core): add Text Search API search strategy #5785
Merged
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
bjoerge
force-pushed
the
feat/adopt-text-search-api
branch
from
February 26, 2024 14:47
ac4775d
to
3e7d439
Compare
juice49
force-pushed
the
feat/adopt-text-search-api
branch
from
February 27, 2024 16:34
3e7d439
to
9035c4e
Compare
ricokahler
force-pushed
the
feat/adopt-text-search-api
branch
from
February 29, 2024 04:10
38a0aa3
to
5da486b
Compare
No changes to documentation |
Component Testing Report Updated Mar 5, 2024 2:38 PM (UTC)
|
juice49
force-pushed
the
feat/adopt-text-search-api
branch
from
March 1, 2024 16:34
53079e7
to
67aa88e
Compare
…, handle next cursor in `SearchRequestComplete` action
juice49
force-pushed
the
feat/adopt-text-search-api
branch
from
March 5, 2024 14:30
9369242
to
9785477
Compare
bjoerge
approved these changes
Mar 5, 2024
jtpetty
approved these changes
Mar 5, 2024
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.
LGTM 👍
juice49
added a commit
that referenced
this pull request
Mar 13, 2024
* feat(core): add Text Search API search strategy * feat(core): support multiple search strategies in `createSearch` function * feat(core): use generic `createSearch` function for navbar search * feat(core): use generic `createSearch` function for reference search * feat(structure): very unsound prototype of Text Search API strategy for document lists * feat(core): export Text Search API types * feat(core): add type filtering to Text Search API request * feat(core): remove unused search weighting for Text Search API search strategy * feat(core): support filtering in Text Search API strategy * refactor(core): specialise `createSearchQuery` function for Text Search API search strategy * feat(core): add `TextSearchParams.params` type * fix(core): allow `TextSearchParams.params` to include any single or array of primitives * refactor(core): return `TextSearchParams` directly * feat(core): add limit to Text Search API search strategy * fix(core): allow non-weighted search hit * refactor(core): remove unused function * fix(core): allow non-weighted search hit * refactor(core): remove unused function * feat(core): scaffold hybrid search strategy * refactor(core): rename for clarity * chore(core): remove irrelevant comment * feat(core): add `search.__experimental_strategy` option for controlling search strategy * feat(test-studio): enable Text Search API search strategy * feat: implement hybrid approach (messy) * refactor(core): rename for clarity * feat(core): add `useDocumentSearch` stub * feat(core): prototype Text Search API pagination with global search * feat(core): support new result data shape in weighted search strategy * refactor(core): refine search result type * fix(core): allow reference search to work with new data shape * refactor(core): improve search strategy types * refactor(core): improve search strategy types * refactor: remove hybrid search and clean up * refactor(core): rename binding * refactor(core): remove unused offset-based pagination, fix pagination, handle next cursor in `SearchRequestComplete` action * fix(core): use new data shape * test(core): remove nonexistent option * fix(core): deduplicate search results * refactor(core): remove unused `useDocumentSearch` hook prototype * test(core): global search pagination * test(core): add assertion * refactor(core): add type parameter for Text Search API hit attributes * refactor(core): remove unused offset * refactor(core): remove unused search offset handling * feat(core): increase default search limit * chore(core): add clarification --------- Co-authored-by: Rico Kahler <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This branch adds the option to use the Text Search API to power Studio search, rather than the existing GROQ query search strategy.
This can be enabled in Studio projects by setting the
search.unstable_enableNewSearch
configuration option totrue
. When enabled, global search, reference search, and Cross Dataset Reference search will all use the Text Search API.In addition, we've removed the unused offset-based pagination from the global search UI, instead implementing infinite scrolling using cursor-based pagination.
What to review
search.unstable_enableNewSearch
is not enabled, the existing search strategy will be used, and results should be unchanged.search.unstable_enableNewSearch
is enabled, search queries will use the Text Search API. Filter the request log bytextsearch
to isolate these requests. It's expected that search results will not match those provided by the existing search strategy at the moment.Testing
packages/sanity/src/core/studio/components/navbar/search/contexts/search/reducer.test.ts
) has been updated to test pagination/infinite scrolling for cursor-based pagination.Notes for release
Draft notes - this has not been widely enabled for datasets yet, so is not ready to be announced.
Please note the new search strategy doesn't yet provide functional parity with the existing search strategy. Notably, field weighting, prefix search, and Portable Text search are absent. You may experience other inconsistencies or unexpected behaviour while this feature is in use.
The new search strategy can be enabled in Studio projects by setting the
search.unstable_enableNewSearch
configuration option totrue
. While we work to make this the default search strategy, we welcome any feedback you have!