@open-mercato/search 0.6.7-develop.6706.1.b3a4c759bb → 0.6.7-develop.6726.1.983ae8a07e
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/AGENTS.md
CHANGED
|
@@ -541,7 +541,7 @@ curl "https://your-app.com/api/search?q=john%20doe&limit=20" \
|
|
|
541
541
|
| `OM_SEARCH_ENABLE_PARTIAL` | When trading `search_tokens` size for prefix matching | Default: `true`. Prefix/partial expansion for tokens (Meilisearch unaffected); increases `search_tokens` size ~5–6×. **Token strategy only** |
|
|
542
542
|
| `OM_SEARCH_HASH_ALGO` | When choosing the token hash algorithm | Default: `sha256` (accepts `sha1`, `md5`). **Token strategy only** |
|
|
543
543
|
| `OM_SEARCH_STORE_RAW_TOKENS` | Almost never — debugging tokenization only | Default: `false`. Stores plaintext token alongside the hash — **security-sensitive**, retains plaintext of otherwise-hashed values. **Token strategy only** |
|
|
544
|
-
| `OM_SEARCH_FIELD_BLOCKLIST` | When extra fields must never be tokenized | Comma-separated field
|
|
544
|
+
| `OM_SEARCH_FIELD_BLOCKLIST` | When extra fields must never be tokenized | Comma-separated field-name substrings, merged with built-in `password,token,secret,hash`; prefix an entry with `entityType@` to scope it to one entity. Applies to per-field tokens and aggregate `search_text`; reindex affected entities after changes. **Token strategy only** |
|
|
545
545
|
| `SEARCH_EXCLUDE_ENCRYPTED_FIELDS` | When you need to keep encrypted fields out of fulltext | Set to `true` to exclude encrypted fields from fulltext index |
|
|
546
546
|
| `OM_LOG_LEVEL` | When debugging presenter enrichment | Set to `debug` to surface presenter enricher diagnostics (replaces the former `DEBUG_SEARCH_ENRICHER` flag) |
|
|
547
547
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return parseBooleanToken(raw) === true;
|
|
7
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
envDisablesAutoIndexing,
|
|
3
|
+
SEARCH_AUTO_INDEX_CONFIG_KEY,
|
|
4
|
+
SEARCH_AUTO_INDEX_CONFIG_MODULE
|
|
5
|
+
} from "@open-mercato/shared/lib/search/auto-indexing";
|
|
8
6
|
async function resolveAutoIndexingEnabled(resolver, options) {
|
|
9
7
|
if (envDisablesAutoIndexing()) return false;
|
|
10
8
|
const fallback = options?.defaultValue ?? true;
|
|
@@ -15,7 +13,7 @@ async function resolveAutoIndexingEnabled(resolver, options) {
|
|
|
15
13
|
return fallback;
|
|
16
14
|
}
|
|
17
15
|
try {
|
|
18
|
-
const value = await service.getValue(
|
|
16
|
+
const value = await service.getValue(SEARCH_AUTO_INDEX_CONFIG_MODULE, SEARCH_AUTO_INDEX_CONFIG_KEY, {
|
|
19
17
|
defaultValue: fallback,
|
|
20
18
|
scope: options?.scope
|
|
21
19
|
});
|
|
@@ -26,6 +24,7 @@ async function resolveAutoIndexingEnabled(resolver, options) {
|
|
|
26
24
|
}
|
|
27
25
|
export {
|
|
28
26
|
SEARCH_AUTO_INDEX_CONFIG_KEY,
|
|
27
|
+
SEARCH_AUTO_INDEX_CONFIG_MODULE,
|
|
29
28
|
envDisablesAutoIndexing,
|
|
30
29
|
resolveAutoIndexingEnabled
|
|
31
30
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/search/lib/auto-indexing.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ConfigScope, ModuleConfigService } from '@open-mercato/core/modules/configs/lib/module-config-service'\nimport {
|
|
5
|
-
"mappings": "AACA
|
|
4
|
+
"sourcesContent": ["import type { ConfigScope, ModuleConfigService } from '@open-mercato/core/modules/configs/lib/module-config-service'\nimport {\n envDisablesAutoIndexing,\n SEARCH_AUTO_INDEX_CONFIG_KEY,\n SEARCH_AUTO_INDEX_CONFIG_MODULE,\n} from '@open-mercato/shared/lib/search/auto-indexing'\n\nexport { envDisablesAutoIndexing, SEARCH_AUTO_INDEX_CONFIG_KEY, SEARCH_AUTO_INDEX_CONFIG_MODULE }\n\ntype Resolver = {\n resolve: <T = unknown>(name: string) => T\n}\n\nexport async function resolveAutoIndexingEnabled(\n resolver: Resolver,\n options?: { defaultValue?: boolean; scope?: ConfigScope },\n): Promise<boolean> {\n if (envDisablesAutoIndexing()) return false\n const fallback = options?.defaultValue ?? true\n let service: ModuleConfigService\n try {\n service = resolver.resolve<ModuleConfigService>('moduleConfigService')\n } catch {\n return fallback\n }\n try {\n const value = await service.getValue<boolean>(SEARCH_AUTO_INDEX_CONFIG_MODULE, SEARCH_AUTO_INDEX_CONFIG_KEY, {\n defaultValue: fallback,\n scope: options?.scope,\n })\n return value !== false\n } catch {\n return fallback\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,eAAsB,2BACpB,UACA,SACkB;AAClB,MAAI,wBAAwB,EAAG,QAAO;AACtC,QAAM,WAAW,SAAS,gBAAgB;AAC1C,MAAI;AACJ,MAAI;AACF,cAAU,SAAS,QAA6B,qBAAqB;AAAA,EACvE,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI;AACF,UAAM,QAAQ,MAAM,QAAQ,SAAkB,iCAAiC,8BAA8B;AAAA,MAC3G,cAAc;AAAA,MACd,OAAO,SAAS;AAAA,IAClB,CAAC;AACD,WAAO,UAAU;AAAA,EACnB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/search",
|
|
3
|
-
"version": "0.6.7-develop.
|
|
3
|
+
"version": "0.6.7-develop.6726.1.983ae8a07e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"zod": "^4.4.3"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
|
-
"@open-mercato/core": "0.6.7-develop.
|
|
131
|
-
"@open-mercato/queue": "0.6.7-develop.
|
|
132
|
-
"@open-mercato/shared": "0.6.7-develop.
|
|
130
|
+
"@open-mercato/core": "0.6.7-develop.6726.1.983ae8a07e",
|
|
131
|
+
"@open-mercato/queue": "0.6.7-develop.6726.1.983ae8a07e",
|
|
132
|
+
"@open-mercato/shared": "0.6.7-develop.6726.1.983ae8a07e"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
135
|
"@types/jest": "^30.0.0",
|
|
@@ -460,7 +460,7 @@ yarn mercato search worker fulltext-indexing --concurrency=5
|
|
|
460
460
|
| `OM_SEARCH_ENABLE_PARTIAL` | Prefix/partial expansion for `search_tokens` (indexing "john" stores hashes for `joh`,`john`). Token/Postgres only — Meilisearch unaffected. Increases `search_tokens` size ~5–6× | `true` |
|
|
461
461
|
| `OM_SEARCH_HASH_ALGO` | Hash algorithm for `search_tokens` tokens (`sha256`/`sha1`/`md5`); token strategy only | `sha256` |
|
|
462
462
|
| `OM_SEARCH_STORE_RAW_TOKENS` | Store plaintext token alongside the hash in `search_tokens` — **security-sensitive** (retains plaintext of otherwise-hashed values); token strategy only | `false` |
|
|
463
|
-
| `OM_SEARCH_FIELD_BLOCKLIST` | Comma-separated
|
|
463
|
+
| `OM_SEARCH_FIELD_BLOCKLIST` | Comma-separated field-name substrings excluded from per-field tokens and aggregate `search_text` (merged with built-in `password,token,secret,hash`); prefix an entry with `entityType@` to scope it to one entity and reindex affected entities after changes; token strategy only | - |
|
|
464
464
|
| `SEARCH_EXCLUDE_ENCRYPTED_FIELDS` | Exclude encrypted fields from Meilisearch indexing | `false` |
|
|
465
465
|
| `QUEUE_STRATEGY` | Queue strategy (`local` or `async`) | `local` |
|
|
466
466
|
| `REDIS_URL` | Redis connection URL for async queues | - |
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { ConfigScope, ModuleConfigService } from '@open-mercato/core/modules/configs/lib/module-config-service'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
envDisablesAutoIndexing,
|
|
4
|
+
SEARCH_AUTO_INDEX_CONFIG_KEY,
|
|
5
|
+
SEARCH_AUTO_INDEX_CONFIG_MODULE,
|
|
6
|
+
} from '@open-mercato/shared/lib/search/auto-indexing'
|
|
3
7
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export function envDisablesAutoIndexing(): boolean {
|
|
7
|
-
const raw =
|
|
8
|
-
process.env.OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING ??
|
|
9
|
-
process.env.DISABLE_VECTOR_SEARCH_AUTOINDEXING
|
|
10
|
-
if (!raw) return false
|
|
11
|
-
return parseBooleanToken(raw) === true
|
|
12
|
-
}
|
|
8
|
+
export { envDisablesAutoIndexing, SEARCH_AUTO_INDEX_CONFIG_KEY, SEARCH_AUTO_INDEX_CONFIG_MODULE }
|
|
13
9
|
|
|
14
10
|
type Resolver = {
|
|
15
11
|
resolve: <T = unknown>(name: string) => T
|
|
@@ -28,8 +24,7 @@ export async function resolveAutoIndexingEnabled(
|
|
|
28
24
|
return fallback
|
|
29
25
|
}
|
|
30
26
|
try {
|
|
31
|
-
|
|
32
|
-
const value = await service.getValue<boolean>('vector', SEARCH_AUTO_INDEX_CONFIG_KEY, {
|
|
27
|
+
const value = await service.getValue<boolean>(SEARCH_AUTO_INDEX_CONFIG_MODULE, SEARCH_AUTO_INDEX_CONFIG_KEY, {
|
|
33
28
|
defaultValue: fallback,
|
|
34
29
|
scope: options?.scope,
|
|
35
30
|
})
|