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

add new globalSearch resolver + update useSearchRecords hook #10457

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

etiennejouan
Copy link
Contributor

@etiennejouan etiennejouan commented Feb 24, 2025

Context

To enable search records sorting by ts_rank_cd / ts_rank, we have decided to add a new search resolver serving GlobalSearchRecordDTO.


  • Test to add - work in progress

closes twentyhq/core-team-issues#357

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

@etiennejouan etiennejouan changed the title add new globalSearch resolver + useSearchRecords hook update add new globalSearch resolver + update useSearchRecords hook Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ranking score in search
1 participant