Skip to content

Conversation

@charislam
Copy link
Contributor

@charislam charislam commented Sep 12, 2025

Create an alternate search index for Nimbus that filters out feature-flagged pages (equivalent to setting all feature flags to
false).

Notes:

  • Creates two new DB tables, page_nimbus and page_section_nimbus, which are filtered versions of page and page_section
  • Makes nimbus versions of all the DB search functions
  • Refactored the embedding upload script. Changes to make it faster (got annoyed by how slow it was when testing...), incorporate retries, and produce better summary logs.
  • Upload script, when run with the environment variable ENABLED_FEATURES_OVERRIDE_DISABLE_ALL, produces and uploads the alternate search index
  • Changed all the search calls in frontend/API to check for isFeatureEnabled('search:fullIndex') to determine whether to search the full or alternate index
  • Adds Nimbus search index production to GitHub Action that generates embeddings

To test

It'll be easiest to test this on local.

  1. Make sure local Supabase is running: pnpm supabase start. If this errors you may need to add dummy GITHUB_CLIENT_ID and GITHUB_SECRET to your .env.
  2. Run migrations: pnpm supabase migration up --local
  3. Make sure your apps/docs/.env.local has NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SECRET_KEY pointing to local Supabase
  4. Upload both search indexes: pnpm embeddings:refresh and pnpm embeddings:nimbus
  5. Test out the search function on the docs site
  6. In enabled-features.json, toggle off the search:fullIndex feature flag
  7. Test the search function again. Try searching for something that's disabled in the Nimbus build, like the Dart SDK

@vercel
Copy link

vercel bot commented Sep 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
design-system Ready Ready Preview Comment Sep 16, 2025 4:02pm
docs Ready Ready Preview Comment Sep 16, 2025 4:02pm
studio-self-hosted Ready Ready Preview Comment Sep 16, 2025 4:02pm
studio-staging Ready Ready Preview Comment Sep 16, 2025 4:02pm
ui-library Ready Ready Preview Comment Sep 16, 2025 4:02pm
zone-www-dot-com Ready Ready Preview Comment Sep 16, 2025 4:02pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cms Ignored Ignored Sep 16, 2025 4:02pm
studio Ignored Ignored Sep 16, 2025 4:02pm

@supabase
Copy link

supabase bot commented Sep 12, 2025

Updates to Preview Branch (charis/docs-415-spike-of-adapting-current-database-to-hide-pages-in-the) ↗︎

Deployments Status Updated
Database Tue, 16 Sep 2025 15:55:42 UTC
Services Tue, 16 Sep 2025 15:55:42 UTC
APIs Tue, 16 Sep 2025 15:55:42 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Tue, 16 Sep 2025 15:55:51 UTC
Migrations Tue, 16 Sep 2025 15:55:53 UTC
Seeding Tue, 16 Sep 2025 15:55:53 UTC
Edge Functions Tue, 16 Sep 2025 15:55:57 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@@ -0,0 +1,325 @@
-- Create nimbus tables for feature-flag-filtered search
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change any logic on these tables and functions, they're just copied over from the existing versions except for appending _nimbus to the names.

Probably some of these are redundant or obsolete, but let's fix that later, just getting the alt search index working now

Create an alternate search index for Nimbus that filters out
feature-flagged pages (equivalent to setting all feature flags to
false).

Notes:
- Creates two new DB tables, `page_nimbus` and `page_section_nimbus`,
  which are filtered versions of `page` and `page_section`
- Makes `nimbus` versions of all the DB search functions
- Refactored the embedding upload script. Changes to make it faster (got
  annoyed by how slow it was when testing...), incorporate retries, and
  produce better summary logs.
- Upload script, when run with the environment variable
  ENABLED_FEATURES_OVERRIDE_DISABLE_ALL, produces and uploads the
  alternate search index
- Changed all the search calls in frontend/API to check for
  `isFeatureEnabled('search:fullIndex')` to determine whether to search
  the full or alternate index
@charislam charislam force-pushed the charis/docs-415-spike-of-adapting-current-database-to-hide-pages-in-the branch from c640b8a to f46b193 Compare September 12, 2025 15:53
@ChrisChinchilla
Copy link
Contributor

@charislam Is there a step missing between 6 and 7? I tried and don't seem to see a difference, even rerunning the embeddings and no difference.

@charislam
Copy link
Contributor Author

@ChrisChinchilla hmmm I don't think so, here is the comparison on my local:

with search:fullIndex: true

CleanShot 2025-09-15 at 18 50 16

with search:fullIndex: false

CleanShot 2025-09-15 at 18 51 19

(the dart references at results 4 & 5 should be gone)

@ChrisChinchilla
Copy link
Contributor

@charislam Either I missunderstood something or a simple "doing it again" fixed the issue. All good now.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 16, 2025
@charislam charislam merged commit 8cd5e10 into master Sep 16, 2025
20 checks passed
@charislam charislam deleted the charis/docs-415-spike-of-adapting-current-database-to-hide-pages-in-the branch September 16, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants