update: semantic search is now Optional configuration

This commit is contained in:
Wayne Sutton
2026-01-05 23:25:42 -08:00
parent 3c9feb071b
commit 85c100451a
5 changed files with 58 additions and 4 deletions

View File

@@ -7,6 +7,29 @@ Date: 2026-01-06
All notable changes to this project.
## v2.10.1
Released January 5, 2026
**Optional semantic search configuration**
Semantic search can now be disabled via `siteConfig.semanticSearch.enabled`:
```typescript
semanticSearch: {
enabled: false, // Disable semantic search, use keyword only
},
```
When disabled:
- Search modal shows only keyword search (no mode toggle)
- Embedding generation skipped during sync (saves API costs)
- Existing embeddings preserved in database (no data loss)
Default is `enabled: false` (keyword search only, no API key required). Set to `true` and configure OPENAI_API_KEY to enable semantic search.
Updated files: `src/config/siteConfig.ts`, `src/components/SearchModal.tsx`, `scripts/sync-posts.ts`, `src/pages/Dashboard.tsx`, `FORK_CONFIG.md`, `fork-config.json.example`, `content/pages/docs-semantic-search.md`, `content/pages/docs.md`
## v2.10.0
Released January 5, 2026

View File

@@ -79,6 +79,31 @@ If the key is not configured:
- Keyword search continues to work normally
- Sync script skips embedding generation
### Enable/Disable Semantic Search
Semantic search is **disabled by default** to avoid requiring API keys for forks. Enable it via `src/config/siteConfig.ts`:
```typescript
semanticSearch: {
enabled: true, // Enable semantic search (requires OPENAI_API_KEY)
},
```
When disabled (default):
- Search modal shows only keyword search (no mode toggle)
- Embedding generation skipped during sync (saves API costs)
- No OpenAI API key required
When enabled:
- Search modal shows both Keyword and Semantic modes
- Embeddings generated during `npm run sync`
- Requires OPENAI_API_KEY in Convex
To enable semantic search:
1. Set `semanticSearch.enabled: true` in siteConfig.ts
2. Set `OPENAI_API_KEY` in Convex: `npx convex env set OPENAI_API_KEY sk-xxx`
3. Run `npm run sync` to generate embeddings
### How embeddings are generated
When you run `npm run sync`:

View File

@@ -88,8 +88,11 @@ Press `Command+K` (Mac) or `Ctrl+K` (Windows/Linux) to open the search modal. Cl
- Result snippets with context around matches
- Distinguishes between posts and pages
- Works with all four themes
- Two search modes: [Keyword](/docs-search) (exact match) and [Semantic](/docs-semantic-search) (meaning-based)
Search uses Convex full text search indexes. No configuration needed.
Search uses Convex full text search indexes. No configuration needed for keyword search.
**Semantic search configuration:** Requires `OPENAI_API_KEY` in Convex. Can be disabled via `siteConfig.semanticSearch.enabled: false`. See [Semantic Search](/docs-semantic-search) for details.
## Copy Page dropdown