WPB-28665: remove ElasticSearch; query user search from Postgres - #5539
Open
blackheaven wants to merge 1 commit into
Open
blackheaven wants to merge 1 commit into
blackheaven wants to merge 1 commit into
Conversation
ElasticSearch backed exactly one feature area: brig user indexing.
Delete the projection entirely and query brig's Postgres wire_user table
directly via a new UserSearchStore Polysemy effect.
New:
- Wire.UserSearchStore effect: searchUsers, searchUsersFederated,
paginateTeamMembers, getTeamSize, setTeamSearchVisibilityInbound
- Wire.UserSearchStore.Postgres interpreter porting the ES semantics:
shouldIndex candidate filter, documented swagger rank order, visibility
via team_search_visibility (default own-team-only), app exclusion,
tokenized prefix matching with LIKE escaping, keyset pagination
- Wire.UserSearch.Normalize (ICU Any-Latin;Latin-ASCII;Lower, formerly
the ES 'normalized' field) now stored in wire_user.name_normalized
- migration: name_normalized + text_pattern_ops indexes +
team_search_visibility table
- brig-index reduced to 'backfill-normalized-names' (run once before
cutover; pre-backfill rows lack name_normalized)
- in-memory mock for MiniBackend unit tests
Deleted:
- Wire.IndexedUserStore*, Wire.UserSearch.{Types,Migration,Metrics},
Wire.UserStore.IndexUser, GetIndexUser/GetIndexUsersPaginated store ops
- Brig.Index.*, Brig.User.Search.{Index,SearchIndex}, IndexEnv/mkIndexEnv
- ISearchIndexAPI routes (/i/index/*), galley updateSearchIndex push,
index-sync call sites, counter metrics
- bloodhound dependency, tools/db/find-undead, elasticsearch/kibana
charts, opensearch releases, dockerephemeral ES services, ES test
fixtures and ES-specific integration tests
Deployment: run `brig-index backfill-normalized-names --pg-settings ...`
after this migration and before search cutover.
Known env-only build failures (untouched packages): integration
Certs.hs (crypton-x509/pem solver skew), spar/federator/stern
integration exes (hidden Test.Hspec.JUnit), extended/saml2 (missing
shared libssl).
fisx
reviewed
Sep 14, 2026
fisx
left a comment
Contributor
There was a problem hiding this comment.
This would be awesome, but the ticket doesn't really say anything about re-architecting anything? Also, shouldn't we do some load testing before we merge this? Or maybe after, before the next release?
This file contains hidden or 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
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.
https://wearezeta.atlassian.net/browse/WPB-28665
Checklist
changelog.d