-
Notifications
You must be signed in to change notification settings - Fork 2.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
add new globalSearch resolver + update useSearchRecords hook #10457
base: main
Are you sure you want to change the base?
Conversation
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.
PR Summary
This PR introduces a comprehensive global search functionality across the Twenty platform, replacing the previous multi-object search implementation with a more efficient and unified approach.
- Added new
GlobalSearchService
in/packages/twenty-server/src/engine/core-modules/global-search/services/global-search.service.ts
implementing PostgreSQL full-text search with proper result ranking - Implemented
formatSearchTerms
utility in/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/utils/format-search-terms.ts
for proper search term escaping and operator handling - Added robust error handling through
GlobalSearchException
class with specific error codes for metadata cache and field identification issues - Simplified frontend search with new
useSearchRecords
hook in/packages/twenty-front/src/modules/command-menu/hooks/useSearchRecords.tsx
using a single global search query - Standardized company logo handling by moving
getLogoUrlFromDomainName
to shared utilities with proper test coverage
Note: The PR title/description mentions fixing token expiration (issue #357) but the changes are focused on global search functionality instead.
23 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile
Context
To enable search records sorting by ts_rank_cd / ts_rank, we have decided to add a new search resolver serving
GlobalSearchRecordDTO
.closes twentyhq/core-team-issues#357