Skip to content

Commit b91d9e9

Browse files
tommoorclaude
andauthored
feat: Extract search into pluggable provider system (outline#11448)
* feat: Extract search into pluggable provider system Refactors the monolithic SearchHelper into a pluggable search provider architecture, enabling alternative search backends (Elasticsearch, Turbopuffer, etc.) while preserving PostgreSQL full-text search as the default. The SEARCH_PROVIDER env var selects the active provider. - Add BaseSearchProvider abstract class and SearchProviderManager - Add Hook.SearchProvider to the plugin system - Move PostgreSQL search logic into plugins/postgres-search/ - Add SearchIndexProcessor for event-driven index sync - Update all callers to use the provider manager directly - Keep SearchHelper as a deprecated thin wrapper for backwards compat Closes outline#11347 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: Remove deprecated SearchHelper wrapper All callers now use SearchProviderManager directly, so the thin delegation wrapper is no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: Rename postgres-search plugin to search-postgres Renames the plugin folder and id so that future search provider plugins (e.g. search-elasticsearch, search-turbopuffer) will be colocated alphabetically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: Remove special-case plugin import from SearchProviderManager Make PluginManager.loadPlugins resilient to individual plugin load failures so SearchProviderManager can use the standard getHooks path without needing to directly import the search-postgres plugin. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: Add missing search provider tests for full coverage parity Adds all tests that existed in the old SearchHelper.test.ts but were missing from PostgresSearchProvider.test.ts, including searchTitlesForUser status filters, collection filtering, group memberships, and sorting tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feedback --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 979d9a4 commit b91d9e9

File tree

17 files changed

+667
-182
lines changed

17 files changed

+667
-182
lines changed

app/stores/UnfurlsStore.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ class UnfurlsStore extends Store<Unfurl<any>> {
2424
}): Promise<Unfurl<UnfurlType> | undefined> => {
2525
try {
2626
const protocol = new URL(url).protocol;
27-
if (protocol !== "http:" && protocol !== "https:" && protocol !== "mention:") {
27+
if (
28+
protocol !== "http:" &&
29+
protocol !== "https:" &&
30+
protocol !== "mention:"
31+
) {
2832
return;
2933
}
3034
} catch (_err) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "search-postgres",
3+
"name": "PostgreSQL Search",
4+
"priority": 0,
5+
"description": "Full-text search powered by PostgreSQL tsvector."
6+
}

0 commit comments

Comments
 (0)