@se-studio/search 1.1.31 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @se-studio/search
2
2
 
3
+ ## 1.1.33
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @se-studio/core-data-types@1.8.0
9
+ - @se-studio/contentful-rest-api@1.19.0
10
+ - @se-studio/markdown-renderer@1.7.18
11
+
12
+ ## 1.1.32
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [bfb7eb4]
17
+ - @se-studio/contentful-rest-api@1.18.1
18
+ - @se-studio/core-data-types@1.7.1
19
+ - @se-studio/markdown-renderer@1.7.17
20
+
3
21
  ## 1.1.31
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -27,13 +27,24 @@ The package is a workspace dependency. Add it to your app's `package.json`:
27
27
  }
28
28
  ```
29
29
 
30
- ### 2. Create an Upstash Search database
30
+ ### 2. Upstash Search database (shared SE standard)
31
31
 
32
- Go to [console.upstash.com/search](https://console.upstash.com/search) and create a database. Copy the REST URL and token.
32
+ **Prefer the shared SE Search database** (`upstash-search-shared`) with **per-site index names**. Do not create a new database per marketing site unless you need hard isolation or a separate region.
33
+
34
+ See **[Shared Upstash Search](../../docs/UPSTASH_SEARCH_SHARED.md)** for the registry, safety rules, and onboarding checklist.
35
+
36
+ | Site | Indexes |
37
+ |------|---------|
38
+ | Pedestal | `pedestal-published` / `pedestal-preview` |
39
+ | Headwater | `headwater-published` / `headwater-preview` |
40
+ | HopSkipDrive | `hsd-published` / `hsd-preview` |
41
+ | SE Studio | `se-studio-published` / `se-studio-preview` |
42
+
43
+ Copy the shared REST URL and write token from the SE vault (`upstash-search-shared`). Never use bare index names `published` / `preview` on the shared DB.
33
44
 
34
45
  ### 3. Environment variables
35
46
 
36
- Add to your `.env.local`:
47
+ Add to your `.env.local` (and Vercel Preview + Production):
37
48
 
38
49
  ```bash
39
50
  UPSTASH_SEARCH_REST_URL=https://your-search-url.upstash.io
@@ -42,7 +53,7 @@ UPSTASH_SEARCH_REST_TOKEN=your-token
42
53
 
43
54
  ### 4. Search config
44
55
 
45
- Create `src/lib/search-config.ts`:
56
+ Create `src/lib/search-config.ts`. Use **site-prefixed** index names:
46
57
 
47
58
  ```typescript
48
59
  import 'server-only';
@@ -54,8 +65,9 @@ export const searchIndexingConfig: SearchIndexingConfig = {
54
65
  url: process.env.UPSTASH_SEARCH_REST_URL ?? '',
55
66
  token: process.env.UPSTASH_SEARCH_REST_TOKEN ?? '',
56
67
  },
57
- publishedIndexName: 'published',
58
- previewIndexName: 'preview',
68
+ // Unique per site on the shared database — never reuse another brand's names
69
+ publishedIndexName: 'example-published',
70
+ previewIndexName: 'example-preview',
59
71
  },
60
72
  contentTypes: [
61
73
  { type: 'page', enabled: true },
@@ -224,7 +236,7 @@ If you must batch requests, you need a strategy that does not depend on unbounde
224
236
 
225
237
  ## Architecture
226
238
 
227
- - **Single Upstash database, two indexes**: `published` and `preview`
239
+ - **Shared SE Upstash database + per-site indexes**: one REST DB (`upstash-search-shared`); each app uses `{site}-published` / `{site}-preview` (see [UPSTASH_SEARCH_SHARED.md](../../docs/UPSTASH_SEARCH_SHARED.md))
228
240
  - **Text extraction**: Uses `MarkdownConverter` to deeply extract text from page components, then strips markdown formatting
229
241
  - **Content truncation**: Body text is truncated to ~4,000 chars (Upstash limit)
230
242
  - **Batch upsert**: Documents are upserted in batches of 100 (Upstash API limit)
package/docs/llms.md CHANGED
@@ -13,6 +13,10 @@ UPSTASH_SEARCH_REST_TOKEN=...
13
13
  # SEARCH_RATE_LIMIT_WINDOW_MS=60000
14
14
  ```
15
15
 
16
+ ## Multi-tenant (shared SE database)
17
+
18
+ Prefer **one** Upstash Search DB (`upstash-search-shared`) for SE marketing sites. Isolate with **index names** only: `{site}-published` / `{site}-preview` (e.g. `hsd-published`, `pedestal-preview`). Never bare `published`/`preview` on the shared DB. Full registry: `docs/UPSTASH_SEARCH_SHARED.md`.
19
+
16
20
  ## Rate limiting (public API + MCP)
17
21
 
18
22
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/search",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "AI-powered site search with Upstash Search for Next.js marketing sites",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,9 +48,9 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@upstash/search": "^0.1.7",
51
- "@se-studio/contentful-rest-api": "1.18.0",
52
- "@se-studio/core-data-types": "1.7.0",
53
- "@se-studio/markdown-renderer": "1.7.16"
51
+ "@se-studio/contentful-rest-api": "1.19.0",
52
+ "@se-studio/core-data-types": "1.8.0",
53
+ "@se-studio/markdown-renderer": "1.7.18"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "next": ">=15.5.0 <16",