@delali/narsil 0.3.1-next.89 → 0.3.1-next.91

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.
Files changed (70) hide show
  1. package/dist/browser/{chunk-JACCR3BJ.mjs → chunk-66KYAOIK.mjs} +1 -1
  2. package/dist/browser/{chunk-3GZQKGVQ.mjs → chunk-B6XE7KXY.mjs} +11 -3
  3. package/dist/browser/{chunk-RAHUQOJL.mjs → chunk-NOUZ6RH3.mjs} +2219 -2005
  4. package/dist/browser/{durability-wiring-VSUBLUDK.mjs → durability-wiring-F4OGQUSU.mjs} +3 -3
  5. package/dist/browser/{snapshot-5MXBEDXF.mjs → snapshot-5EJ7I7QY.mjs} +12 -6
  6. package/dist/browser/{write-6SBYTS62.mjs → write-K5V4XQ72.mjs} +2 -2
  7. package/dist/{capabilities-SJPttcgQ.d.ts → capabilities-CvExBThq.d.ts} +11 -3
  8. package/dist/{chunk-MWJIAREY.mjs → chunk-3RDS4UHC.mjs} +2 -2
  9. package/dist/{chunk-QAMUC2BJ.mjs → chunk-3TTYK5A7.mjs} +7 -6
  10. package/dist/{chunk-URGLSNKR.mjs → chunk-43ORORN6.mjs} +201 -15
  11. package/dist/{chunk-A3UB2MXL.mjs → chunk-5ER245FI.mjs} +2 -505
  12. package/dist/{chunk-VY4DXZ5P.mjs → chunk-67Z2V6TC.mjs} +1 -1
  13. package/dist/{chunk-EMXAYPTQ.mjs → chunk-6VZ3Q73N.mjs} +2265 -3461
  14. package/dist/{chunk-S4LQDSUL.mjs → chunk-7OQHSDK6.mjs} +3 -3
  15. package/dist/chunk-7X5JST5L.mjs +114 -0
  16. package/dist/{chunk-R6BMMQXH.mjs → chunk-A4G7JSYO.mjs} +106 -41
  17. package/dist/{chunk-DCK4P5BI.mjs → chunk-BJ2YKRNX.mjs} +16 -7
  18. package/dist/{chunk-J2BPXTD7.mjs → chunk-CO4MRKST.mjs} +1 -1
  19. package/dist/{chunk-CL4OM7GB.mjs → chunk-EONIHG3V.mjs} +8 -4
  20. package/dist/chunk-MKWUXWQH.mjs +35 -0
  21. package/dist/chunk-NVL4ZR3K.mjs +426 -0
  22. package/dist/{chunk-GCM3JFVA.mjs → chunk-OHP7QR33.mjs} +2 -1
  23. package/dist/{chunk-YRX6XMOQ.mjs → chunk-R6PR4WYZ.mjs} +1 -0
  24. package/dist/{chunk-OOSIDHA3.mjs → chunk-RSRVGAIQ.mjs} +1 -1
  25. package/dist/{chunk-V7YUSKKZ.mjs → chunk-T4DB5YFB.mjs} +7 -3
  26. package/dist/{chunk-XSZVS4S3.mjs → chunk-UXQE2ROB.mjs} +6 -2
  27. package/dist/chunk-X5CV2E2B.mjs +1 -0
  28. package/dist/chunk-XLJ2S2BH.mjs +3572 -0
  29. package/dist/chunk-ZIJ63TBT.mjs +507 -0
  30. package/dist/{client-BMK53IR2.d.ts → client-Cc42b42j.d.ts} +27 -3
  31. package/dist/client.d.ts +9 -8
  32. package/dist/client.mjs +15 -2
  33. package/dist/{config-BUR-7eVQ.d.ts → config-BYne-yCI.d.ts} +2 -2
  34. package/dist/{config-UJx1dyX1.d.ts → config-DyRowvVP.d.ts} +2 -2
  35. package/dist/{direct-executor-EGESD26S.mjs → direct-executor-CHXVCBN7.mjs} +9 -5
  36. package/dist/distribution/coordinator/etcd.d.ts +3 -2
  37. package/dist/distribution/coordinator/etcd.mjs +4 -0
  38. package/dist/distribution/coordinator/in-memory.d.ts +3 -2
  39. package/dist/distribution/coordinator/in-memory.mjs +4 -0
  40. package/dist/distribution/transport/grpc.mjs +2 -2
  41. package/dist/distribution/transport/in-memory.mjs +1 -1
  42. package/dist/distribution/transport/tcp.mjs +2 -2
  43. package/dist/distribution.d.ts +43 -9
  44. package/dist/distribution.mjs +4590 -4263
  45. package/dist/{durability-wiring-ZLRQU6FG.mjs → durability-wiring-6AN4QTT3.mjs} +20 -16
  46. package/dist/{engine-9X6W5naj.d.ts → engine-96_kLtSY.d.ts} +43 -7
  47. package/dist/{index-vCMu8OeQ.d.ts → index-ONAEaqtx.d.ts} +8 -1
  48. package/dist/index.browser.mjs +1 -1
  49. package/dist/index.d.ts +44 -25
  50. package/dist/index.mjs +13 -9
  51. package/dist/{memory-CV9NAxLY.d.ts → memory-dd3GESdc.d.ts} +3 -3
  52. package/dist/partial-words.mjs +2 -1
  53. package/dist/persistence/durability/checkpoint-worker.d.ts +60 -58
  54. package/dist/persistence/durability/checkpoint-worker.mjs +18 -14
  55. package/dist/react.d.ts +8 -7
  56. package/dist/{schema-DtsgmNfU.d.ts → schema-DttzM-ln.d.ts} +12 -0
  57. package/dist/server.d.ts +11 -10
  58. package/dist/server.mjs +33 -6
  59. package/dist/{snapshot-22CUEYYW.mjs → snapshot-JFZVOGZV.mjs} +28 -18
  60. package/dist/synonyms-CpOAHPa-.d.ts +52 -0
  61. package/dist/synonyms.d.ts +22 -0
  62. package/dist/synonyms.mjs +12 -0
  63. package/dist/{tasks-BGaZJyoY.d.ts → tasks-DA1Ff0G4.d.ts} +4 -1
  64. package/dist/{thread-ZP3UMIZT.mjs → thread-VTDLLYXC.mjs} +7 -5
  65. package/dist/vector/search-worker.d.ts +2 -1
  66. package/dist/workers/entry.mjs +4 -4
  67. package/dist/{write-PXDKPG2R.mjs → write-OJR3H4BI.mjs} +14 -10
  68. package/package.json +15 -7
  69. package/dist/chunk-PR4O7CAP.mjs +0 -18
  70. package/dist/chunk-X4SEXL4U.mjs +0 -2310
@@ -1,38 +1,42 @@
1
- import { readMetadataEnvelope, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, writeMetadataEnvelope, readCurrentManifest, deserializePayloadV2, unpackEnvelopeBytes, growPartitionsTo, documentsOfPayloadV2 } from './chunk-V7YUSKKZ.mjs';
2
- import { decodeSegmentManifest, metadataFromConfig, createSeqOwner, isRecord, invalidManifest, SINGLE_NODE_PRIMARY_TERM, writeLiveVectors, isId, isUint32, isSequenceNumber, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf } from './chunk-CL4OM7GB.mjs';
1
+ import { readMetadataEnvelope, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, writeMetadataEnvelope, readCurrentManifest, deserializePayloadV2, unpackEnvelopeBytes, growPartitionsTo, documentsOfPayloadV2 } from './chunk-T4DB5YFB.mjs';
2
+ import { decodeSegmentManifest, metadataFromConfig, createSeqOwner, isRecord, invalidManifest, SINGLE_NODE_PRIMARY_TERM, writeLiveVectors, isId, isUint32, isSequenceNumber, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf } from './chunk-EONIHG3V.mjs';
3
3
  import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-YCJLVNWR.mjs';
4
4
  import './chunk-37CD3OKS.mjs';
5
- import { createDurableDirectory } from './chunk-VY4DXZ5P.mjs';
6
- import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, checkpointLastSeqNo, commitCheckpointManifest, removeCheckpointGarbage, readSegmentFile, checkpointPrimaryTerm, writeCheckpointSegments, partitionContentsOf, frameRecord, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, readCommitMarker, readWalSegments, durableRecordMissing, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, SEGMENT_HEADER_SIZE, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, LOG_RECORDS_PER_CHECKPOINT, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, buildEntry } from './chunk-QAMUC2BJ.mjs';
7
- import { applyDeleteEntry, applyIndexEntry } from './chunk-MWJIAREY.mjs';
8
- import './chunk-GCM3JFVA.mjs';
9
- import './chunk-P36MUFEJ.mjs';
5
+ import { createDurableDirectory } from './chunk-67Z2V6TC.mjs';
10
6
  import { spawnNodeWorker } from './chunk-C7SLA6CM.mjs';
11
- import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-R6BMMQXH.mjs';
12
- import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-EMXAYPTQ.mjs';
13
- import './chunk-DCK4P5BI.mjs';
14
- import { fnv1a } from './chunk-X4SEXL4U.mjs';
15
- import './chunk-J2BPXTD7.mjs';
16
- import './chunk-PR4O7CAP.mjs';
7
+ import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, checkpointLastSeqNo, commitCheckpointManifest, removeCheckpointGarbage, readSegmentFile, checkpointPrimaryTerm, writeCheckpointSegments, partitionContentsOf, frameRecord, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, readCommitMarker, readWalSegments, durableRecordMissing, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, SEGMENT_HEADER_SIZE, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, LOG_RECORDS_PER_CHECKPOINT, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, buildEntry } from './chunk-3TTYK5A7.mjs';
8
+ import { applyDeleteEntry, applyIndexEntry } from './chunk-3RDS4UHC.mjs';
9
+ import './chunk-OHP7QR33.mjs';
10
+ import './chunk-P36MUFEJ.mjs';
11
+ import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-A4G7JSYO.mjs';
17
12
  import { resolveWorkerEntry, MAX_FILE_BYTES } from './chunk-RVM7AODE.mjs';
13
+ import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-XLJ2S2BH.mjs';
14
+ import './chunk-BJ2YKRNX.mjs';
15
+ import { fnv1a } from './chunk-6VZ3Q73N.mjs';
16
+ import './chunk-CO4MRKST.mjs';
18
17
  import { detectRuntime } from './chunk-AV4IJKD2.mjs';
18
+ import './chunk-MKWUXWQH.mjs';
19
19
  import './chunk-Q5DC6WAB.mjs';
20
20
  import './chunk-TGP5M5R7.mjs';
21
+ import './chunk-U2BKYEC7.mjs';
21
22
  import './chunk-Y2F66IQJ.mjs';
22
23
  import './chunk-ZJ4CSAB2.mjs';
23
24
  import './chunk-QZN3MIJ3.mjs';
24
25
  import './chunk-T6CNO72J.mjs';
25
26
  import './chunk-WQBCBKY3.mjs';
26
- import './chunk-A3UB2MXL.mjs';
27
+ import './chunk-5ER245FI.mjs';
27
28
  import { encodeDocument, requireValidFieldTypes } from './chunk-CVQWQVFX.mjs';
28
29
  import './chunk-FGMGUDHX.mjs';
29
30
  import { MIN_M } from './chunk-KEHK2O6P.mjs';
30
31
  import './chunk-GES7U2PM.mjs';
31
32
  import './chunk-BVOJIYRV.mjs';
32
- import './chunk-U2BKYEC7.mjs';
33
+ import './chunk-NVL4ZR3K.mjs';
34
+ import './chunk-X5CV2E2B.mjs';
35
+ import './chunk-7X5JST5L.mjs';
36
+ import './chunk-ZIJ63TBT.mjs';
33
37
  import './chunk-R6A773WK.mjs';
34
38
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
35
- import './chunk-YRX6XMOQ.mjs';
39
+ import './chunk-R6PR4WYZ.mjs';
36
40
  import './chunk-R7OSDAFK.mjs';
37
41
  import './chunk-L5ORED7V.mjs';
38
42
  import { NarsilError, ErrorCodes } from './chunk-TPJU7NDJ.mjs';
@@ -1,6 +1,7 @@
1
1
  import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
- import { B as BatchResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, L as ListParams, h as ListResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './memory-CV9NAxLY.js';
3
- import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-DtsgmNfU.js';
2
+ import { B as BatchResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, L as ListParams, h as ListResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './memory-dd3GESdc.js';
3
+ import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-DttzM-ln.js';
4
+ import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
4
5
 
5
6
  /**
6
7
  * Opens and closes durable indexes without deleting them.
@@ -24,6 +25,42 @@ interface IndexLifecycleOperations {
24
25
  close(indexName: string): Promise<void>;
25
26
  }
26
27
 
28
+ /**
29
+ * Reads and replaces the synonym set of an index, which
30
+ * {@link IndexConfig.synonyms} sets when the index is created.
31
+ *
32
+ * @public
33
+ */
34
+ interface SynonymOperations {
35
+ /**
36
+ * Replaces the synonym set of an index, so that every search that starts
37
+ * after the promise resolves expands its words with the new set.
38
+ *
39
+ * The engine applies the set without rebuilding the index, because a
40
+ * synonym set changes no stored token. It saves the set with the index, so
41
+ * the set stays in place after a restart, and every snapshot of the index
42
+ * includes it. Where the index has copies on worker threads, the promise
43
+ * resolves only once every copy uses the new set. Pass an empty list to
44
+ * remove the set.
45
+ *
46
+ * @param indexName - The index whose set the engine replaces.
47
+ * @param synonyms - The new set, in the shape that {@link SynonymRule}
48
+ * describes.
49
+ * @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
50
+ * shape, when a word analyses to no token or to more than one, or when the
51
+ * set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
52
+ * UTF-8. The index then keeps the set that it held before the call.
53
+ */
54
+ updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
55
+ /**
56
+ * Returns the synonym set of an index with every word as the caller wrote
57
+ * it, or an empty list when the index holds no set.
58
+ *
59
+ * @param indexName - The index whose set the engine returns.
60
+ */
61
+ getSynonyms(indexName: string): Promise<SynonymRule[]>;
62
+ }
63
+
27
64
  /**
28
65
  * Adds, replaces, and removes documents, and waits for the worker copies to
29
66
  * catch up with those writes.
@@ -141,13 +178,12 @@ type ByteSource = Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8A
141
178
  *
142
179
  * One instance holds every index you create, so an application usually keeps a
143
180
  * single engine for its lifetime and reaches each index by name. Build one
144
- * with {@link createNarsil}. The write methods come from
145
- * {@link DocumentWriteOperations} and the open and close methods from
146
- * {@link IndexLifecycleOperations}.
181
+ * with {@link createNarsil}. Its write, open and close, and synonym methods come from
182
+ * {@link DocumentWriteOperations}, {@link IndexLifecycleOperations}, and {@link SynonymOperations}.
147
183
  *
148
184
  * @public
149
185
  */
150
- interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations {
186
+ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations {
151
187
  /**
152
188
  * Creates an index you can insert documents into and query.
153
189
  *
@@ -508,4 +544,4 @@ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations {
508
544
  shutdown(): Promise<void>;
509
545
  }
510
546
 
511
- export type { ByteSource as B, DocumentWriteOperations as D, IndexLifecycleOperations as I, Narsil as N };
547
+ export type { ByteSource as B, DocumentWriteOperations as D, IndexLifecycleOperations as I, Narsil as N, SynonymOperations as S };
@@ -1,4 +1,4 @@
1
- import { S as SchemaDefinition } from './schema-DtsgmNfU.js';
1
+ import { S as SchemaDefinition } from './schema-DttzM-ln.js';
2
2
 
3
3
  /**
4
4
  * What a node does in a cluster. A node may hold several roles at once.
@@ -333,6 +333,13 @@ interface ClusterCoordinator {
333
333
  * @returns True when the write went through.
334
334
  */
335
335
  compareAndSet(key: string, expected: Uint8Array | null, value: Uint8Array): Promise<boolean>;
336
+ /**
337
+ * Removes one key of cluster metadata, and does nothing when the key already
338
+ * holds nothing.
339
+ *
340
+ * @param key - The key to remove.
341
+ */
342
+ delete(key: string): Promise<void>;
336
343
  /**
337
344
  * Reads one index's schema, which is how a node joining later learns the
338
345
  * layout of an index it has never held.
@@ -1,2 +1,2 @@
1
- export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerTokenizer, resetNormalizationCache } from './browser/chunk-RAHUQOJL.mjs';
1
+ export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-NOUZ6RH3.mjs';
2
2
  export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError, isSimdAvailable } from './browser/chunk-FHFFWLEK.mjs';
package/dist/index.d.ts CHANGED
@@ -1,14 +1,16 @@
1
- import { c as StopWordOverride, C as CustomTokenizer } from './schema-DtsgmNfU.js';
2
- export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldOptionChain, d as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, b as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, e as VectorQuantizationMode, f as VectorStorageMode, W as WriteOptions } from './schema-DtsgmNfU.js';
1
+ import { c as StopWordOverride, C as CustomTokenizer } from './schema-DttzM-ln.js';
2
+ export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldOptionChain, d as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, b as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, e as VectorQuantizationMode, f as VectorStorageMode, W as WriteOptions } from './schema-DttzM-ln.js';
3
3
  import { P as PartialWordSearch } from './partial-words-DTIHO8G4.js';
4
4
  import { P as PatternSearch } from './pattern-Cledccbl.js';
5
+ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
6
+ export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
5
7
  import { L as LanguageModule } from './language-DB8KG1z5.js';
6
8
  export { T as TokenizerConfig } from './language-DB8KG1z5.js';
7
- export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HighlightConfig, x as HighlightMatch, y as Hit, z as HybridConfig, I as IndexInfo, g as IndexStats, L as ListParams, h as ListResult, J as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, P as PartitionStatsResult, j as PreflightResult, K as PresenceFilter, O as ProcessMemoryReport, R as QueryCoverage, Q as QueryParams, e as QueryResult, T as ScoreComponents, U as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, W as SortField, X as SortSpec, Y as StringFilter, k as SuggestParams, l as SuggestResult, Z as TermMatchPolicy, V as VectorMaintenanceResult, _ as VectorQueryConfig, $ as WorkerCopyReport, i as isNarsilError } from './memory-CV9NAxLY.js';
8
- import { N as NarsilConfig } from './config-BUR-7eVQ.js';
9
- export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-BUR-7eVQ.js';
10
- import { N as Narsil } from './engine-9X6W5naj.js';
11
- export { B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations } from './engine-9X6W5naj.js';
9
+ export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HighlightConfig, x as HighlightMatch, y as Hit, z as HybridConfig, I as IndexInfo, g as IndexStats, L as ListParams, h as ListResult, J as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, P as PartitionStatsResult, j as PreflightResult, K as PresenceFilter, O as ProcessMemoryReport, R as QueryCoverage, Q as QueryParams, e as QueryResult, T as ScoreComponents, U as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, W as SortField, X as SortSpec, Y as StringFilter, k as SuggestParams, l as SuggestResult, Z as TermMatchPolicy, V as VectorMaintenanceResult, _ as VectorQueryConfig, $ as WorkerCopyReport, i as isNarsilError } from './memory-dd3GESdc.js';
10
+ import { N as NarsilConfig } from './config-BYne-yCI.js';
11
+ export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-BYne-yCI.js';
12
+ import { N as Narsil } from './engine-96_kLtSY.js';
13
+ export { B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-96_kLtSY.js';
12
14
  export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter } from './adapters-79OIa4xm.js';
13
15
 
14
16
  /**
@@ -82,6 +84,23 @@ declare function getTokenizer(name: string): CustomTokenizer;
82
84
  */
83
85
  declare function getStopWords(name: string): StopWordOverride;
84
86
 
87
+ /**
88
+ * Creates a search engine that runs inside your process, with no server to
89
+ * provision.
90
+ *
91
+ * The engine holds every index you create, so an application usually keeps one
92
+ * instance for its lifetime. When you configure persistence, this recovers the
93
+ * indexes already on disk before it resolves. Lifecycle settings register
94
+ * those indexes as closed and load each one when its first request arrives.
95
+ *
96
+ * @param config - This carries the persistence, partitioning, and worker
97
+ * invalidation settings. Omit it for an engine that keeps everything in memory.
98
+ * @returns The engine, ready for {@link Narsil.createIndex} to run against.
99
+ *
100
+ * @public
101
+ */
102
+ declare function createNarsil(config?: NarsilConfig): Promise<Narsil>;
103
+
85
104
  /**
86
105
  * Call this to give the engine the partial-word search code, so that it can
87
106
  * create and load an index with a field whose type includes `partial`.
@@ -118,6 +137,23 @@ declare function registerPartialWordSearch(module: PartialWordSearch): void;
118
137
  */
119
138
  declare function registerPatternSearch(module: PatternSearch): void;
120
139
 
140
+ /**
141
+ * Call this to give the engine its synonym code, so that it can create and
142
+ * load an index that holds a synonym set.
143
+ *
144
+ * A Node process loads that code by itself, so only a browser app has to make
145
+ * this call. In a browser, import `synonyms` from `@delali/narsil/synonyms` and
146
+ * pass it here before the app creates or loads an index with a synonym set.
147
+ *
148
+ * @param module - Pass the `synonyms` object that `@delali/narsil/synonyms`
149
+ * exports.
150
+ * @throws The engine throws a `NarsilError` with `CONFIG_INVALID` for any
151
+ * other object.
152
+ *
153
+ * @public
154
+ */
155
+ declare function registerSynonyms(module: SynonymSearch): void;
156
+
121
157
  /**
122
158
  * Sets how many normalised tokens the engine keeps cached.
123
159
  *
@@ -186,23 +222,6 @@ declare function registerLanguage(module: LanguageModule): void;
186
222
  */
187
223
  declare function getLanguage(name: string): LanguageModule;
188
224
 
189
- /**
190
- * Creates a search engine that runs inside your process, with no server to
191
- * provision.
192
- *
193
- * The engine holds every index you create, so an application usually keeps one
194
- * instance for its lifetime. When you configure persistence, this recovers the
195
- * indexes already on disk before it resolves. Lifecycle settings register
196
- * those indexes as closed and load each one when its first request arrives.
197
- *
198
- * @param config - This carries the persistence, partitioning, and worker
199
- * invalidation settings. Omit it for an engine that keeps everything in memory.
200
- * @returns The engine, ready for {@link Narsil.createIndex} to run against.
201
- *
202
- * @public
203
- */
204
- declare function createNarsil(config?: NarsilConfig): Promise<Narsil>;
205
-
206
225
  /**
207
226
  * Reports whether the runtime can run the SIMD module that speeds up vector
208
227
  * distance work.
@@ -230,4 +249,4 @@ declare function isSimdAvailable(): boolean;
230
249
  */
231
250
  declare const VERSION = "0.1.0";
232
251
 
233
- export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, PartialWordSearch, PatternSearch, StopWordOverride, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerTokenizer, resetNormalizationCache };
252
+ export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, PartialWordSearch, PatternSearch, StopWordOverride, SynonymSearch, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache };
package/dist/index.mjs CHANGED
@@ -1,28 +1,32 @@
1
- export { VERSION, createNarsil } from './chunk-R6BMMQXH.mjs';
2
- export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-EMXAYPTQ.mjs';
3
- import './chunk-DCK4P5BI.mjs';
4
- export { registerPartialWordSearch, registerPatternSearch } from './chunk-X4SEXL4U.mjs';
5
- import './chunk-J2BPXTD7.mjs';
6
- export { getLanguage, registerLanguage } from './chunk-PR4O7CAP.mjs';
1
+ export { VERSION, createNarsil } from './chunk-A4G7JSYO.mjs';
7
2
  import './chunk-RVM7AODE.mjs';
3
+ export { registerSynonyms } from './chunk-XLJ2S2BH.mjs';
4
+ import './chunk-BJ2YKRNX.mjs';
5
+ export { registerPartialWordSearch, registerPatternSearch } from './chunk-6VZ3Q73N.mjs';
6
+ import './chunk-CO4MRKST.mjs';
8
7
  import './chunk-AV4IJKD2.mjs';
8
+ export { getLanguage, registerLanguage } from './chunk-MKWUXWQH.mjs';
9
9
  import './chunk-Q5DC6WAB.mjs';
10
10
  import './chunk-TGP5M5R7.mjs';
11
+ import './chunk-U2BKYEC7.mjs';
11
12
  export { isSimdAvailable } from './chunk-Y2F66IQJ.mjs';
12
13
  import './chunk-ZJ4CSAB2.mjs';
13
14
  import './chunk-QZN3MIJ3.mjs';
14
15
  import './chunk-T6CNO72J.mjs';
15
16
  import './chunk-WQBCBKY3.mjs';
16
- export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-A3UB2MXL.mjs';
17
+ import './chunk-5ER245FI.mjs';
17
18
  import './chunk-CVQWQVFX.mjs';
18
19
  import './chunk-FGMGUDHX.mjs';
19
20
  import './chunk-KEHK2O6P.mjs';
20
21
  import './chunk-GES7U2PM.mjs';
21
22
  import './chunk-BVOJIYRV.mjs';
22
- import './chunk-U2BKYEC7.mjs';
23
+ export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-NVL4ZR3K.mjs';
24
+ import './chunk-X5CV2E2B.mjs';
25
+ import './chunk-7X5JST5L.mjs';
26
+ export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-ZIJ63TBT.mjs';
23
27
  import './chunk-R6A773WK.mjs';
24
28
  import './chunk-YTJCGKM4.mjs';
25
- import './chunk-YRX6XMOQ.mjs';
29
+ import './chunk-R6PR4WYZ.mjs';
26
30
  import './chunk-R7OSDAFK.mjs';
27
31
  import './chunk-L5ORED7V.mjs';
28
32
  export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-TPJU7NDJ.mjs';
@@ -1,4 +1,4 @@
1
- import { A as AnyDocument, S as SchemaDefinition, b as ScoringMode } from './schema-DtsgmNfU.js';
1
+ import { A as AnyDocument, S as SchemaDefinition, b as ScoringMode } from './schema-DttzM-ln.js';
2
2
 
3
3
  /**
4
4
  * Every code a {@link NarsilError} carries, grouped by the part of the engine
@@ -1080,8 +1080,8 @@ interface QueryParams {
1080
1080
  partialWords?: boolean;
1081
1081
  /**
1082
1082
  * With this set, the engine matches each query term only against an equal
1083
- * indexed term, so it turns off fuzzy matching, prefix completion, and
1084
- * partial-word matching. The engine still stems the query, because the
1083
+ * indexed term, so it turns off fuzzy matching, prefix completion,
1084
+ * partial-word matching, and synonyms. The engine still stems the query, because the
1085
1085
  * index stores stemmed terms, so a search for `running` matches a document
1086
1086
  * that contains `runs` through the stem that both words share.
1087
1087
  */
@@ -1,9 +1,10 @@
1
- import { partialWordSearchModule } from './chunk-A3UB2MXL.mjs';
1
+ import { partialWordSearchModule } from './chunk-5ER245FI.mjs';
2
2
  import './chunk-CVQWQVFX.mjs';
3
3
  import './chunk-FGMGUDHX.mjs';
4
4
  import './chunk-KEHK2O6P.mjs';
5
5
  import './chunk-GES7U2PM.mjs';
6
6
  import './chunk-BVOJIYRV.mjs';
7
+ import './chunk-ZIJ63TBT.mjs';
7
8
  import './chunk-R6A773WK.mjs';
8
9
  import './chunk-YTJCGKM4.mjs';
9
10
  import './chunk-L5ORED7V.mjs';
@@ -1,56 +1,14 @@
1
- import { P as PartitionConfig, b as ScoringMode, V as VectorIndexConfig } from '../../schema-DtsgmNfU.js';
1
+ import { P as PartitionConfig, b as ScoringMode, V as VectorIndexConfig } from '../../schema-DttzM-ln.js';
2
2
  import '../../adapters-79OIa4xm.js';
3
+ import '../../synonyms-CpOAHPa-.js';
3
4
 
4
- interface IndexMetadata {
5
- indexName: string;
6
- /** Number of documents represented by the last completed checkpoint. */
7
- documentCount?: number;
8
- /** The identity a cluster gave the index at creation; absent on a single engine. */
9
- indexUuid?: string;
10
- /** The partitions this copy holds, which a cluster node answers a partition-stores request from. */
11
- heldPartitions?: number[];
12
- schema: Record<string, string>;
13
- language: string;
14
- partitionCount: number;
15
- bm25Params: {
16
- k1: number;
17
- b: number;
18
- };
19
- createdAt: number;
20
- engineVersion: string;
21
- vectorFields?: Record<string, {
22
- dimension: number;
23
- metric: string;
24
- quantization: string;
25
- }>;
26
- embedding?: IndexEmbeddingMetadata;
27
- /** Persisted so recovered indexes keep collecting surface forms. */
28
- surfaceForms?: boolean;
29
- analysisRevision?: string;
30
- tokenizer?: string;
31
- stopWords?: string;
32
- stopWordList?: string[];
33
- partitionLimits?: PartitionConfig;
34
- defaultScoring?: ScoringMode;
35
- trackPositions?: boolean;
36
- strict?: boolean;
37
- required?: string[];
38
- vectorPromotion?: VectorIndexConfig;
39
- patternValueLimit?: number;
40
- }
41
- /** Persisted so recovery can restore field mappings and rebind the adapter by
42
- * name; the name is absent when the index was configured with a bare instance. */
43
- interface IndexEmbeddingMetadata {
44
- adapter?: string;
45
- fields: Record<string, string | string[]>;
5
+ interface PatternIndexArrays {
6
+ fieldPath: string;
7
+ docIds: Uint32Array;
8
+ runs: Uint32Array;
9
+ offsets: Uint32Array;
10
+ postings: Uint32Array;
46
11
  }
47
- /**
48
- * Persisted surface-form dictionary of one partition. Keys are the
49
- * unstemmed display tokens; the value is the occurrence count when the
50
- * surface equals its index token, or `[count, indexToken]` when stemming
51
- * changed it.
52
- */
53
- type SerializedSurfaceForms = Record<string, number | [number, string]>;
54
12
 
55
13
  interface FrozenTokenTableData {
56
14
  blob: Uint8Array;
@@ -59,14 +17,6 @@ interface FrozenTokenTableData {
59
17
  documentFrequencies: Uint32Array;
60
18
  }
61
19
 
62
- interface PatternIndexArrays {
63
- fieldPath: string;
64
- docIds: Uint32Array;
65
- runs: Uint32Array;
66
- offsets: Uint32Array;
67
- postings: Uint32Array;
68
- }
69
-
70
20
  interface PartialSpellings {
71
21
  fields: string[];
72
22
  tokens: string[];
@@ -205,6 +155,58 @@ interface PartitionManifestEntry {
205
155
  segments: SegmentRef[];
206
156
  }
207
157
 
158
+ interface IndexMetadata {
159
+ indexName: string;
160
+ /** Number of documents represented by the last completed checkpoint. */
161
+ documentCount?: number;
162
+ /** The identity a cluster gave the index at creation; absent on a single engine. */
163
+ indexUuid?: string;
164
+ /** The partitions this copy holds, which a cluster node answers a partition-stores request from. */
165
+ heldPartitions?: number[];
166
+ schema: Record<string, string>;
167
+ language: string;
168
+ partitionCount: number;
169
+ bm25Params: {
170
+ k1: number;
171
+ b: number;
172
+ };
173
+ createdAt: number;
174
+ engineVersion: string;
175
+ vectorFields?: Record<string, {
176
+ dimension: number;
177
+ metric: string;
178
+ quantization: string;
179
+ }>;
180
+ embedding?: IndexEmbeddingMetadata;
181
+ /** Persisted so recovered indexes keep collecting surface forms. */
182
+ surfaceForms?: boolean;
183
+ analysisRevision?: string;
184
+ tokenizer?: string;
185
+ stopWords?: string;
186
+ stopWordList?: string[];
187
+ partitionLimits?: PartitionConfig;
188
+ defaultScoring?: ScoringMode;
189
+ trackPositions?: boolean;
190
+ strict?: boolean;
191
+ required?: string[];
192
+ vectorPromotion?: VectorIndexConfig;
193
+ patternValueLimit?: number;
194
+ synonyms?: unknown;
195
+ }
196
+ /** Persisted so recovery can restore field mappings and rebind the adapter by
197
+ * name; the name is absent when the index was configured with a bare instance. */
198
+ interface IndexEmbeddingMetadata {
199
+ adapter?: string;
200
+ fields: Record<string, string | string[]>;
201
+ }
202
+ /**
203
+ * Persisted surface-form dictionary of one partition. Keys are the
204
+ * unstemmed display tokens; the value is the occurrence count when the
205
+ * surface equals its index token, or `[count, indexToken]` when stemming
206
+ * changed it.
207
+ */
208
+ type SerializedSurfaceForms = Record<string, number | [number, string]>;
209
+
208
210
  interface CapturedSegment {
209
211
  snapshot: SharedSegmentSnapshot;
210
212
  keep: Uint8Array;
@@ -1,34 +1,38 @@
1
- import { createDurableDirectory } from '../../chunk-VY4DXZ5P.mjs';
2
- import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-QAMUC2BJ.mjs';
3
- import '../../chunk-MWJIAREY.mjs';
4
- import '../../chunk-GCM3JFVA.mjs';
5
- import '../../chunk-P36MUFEJ.mjs';
1
+ import { createDurableDirectory } from '../../chunk-67Z2V6TC.mjs';
6
2
  import '../../chunk-C7SLA6CM.mjs';
7
- import '../../chunk-R6BMMQXH.mjs';
8
- import '../../chunk-EMXAYPTQ.mjs';
9
- import '../../chunk-DCK4P5BI.mjs';
10
- import '../../chunk-X4SEXL4U.mjs';
11
- import '../../chunk-J2BPXTD7.mjs';
12
- import '../../chunk-PR4O7CAP.mjs';
3
+ import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-3TTYK5A7.mjs';
4
+ import '../../chunk-3RDS4UHC.mjs';
5
+ import '../../chunk-OHP7QR33.mjs';
6
+ import '../../chunk-P36MUFEJ.mjs';
7
+ import '../../chunk-A4G7JSYO.mjs';
13
8
  import '../../chunk-RVM7AODE.mjs';
9
+ import '../../chunk-XLJ2S2BH.mjs';
10
+ import '../../chunk-BJ2YKRNX.mjs';
11
+ import '../../chunk-6VZ3Q73N.mjs';
12
+ import '../../chunk-CO4MRKST.mjs';
14
13
  import '../../chunk-AV4IJKD2.mjs';
14
+ import '../../chunk-MKWUXWQH.mjs';
15
15
  import '../../chunk-Q5DC6WAB.mjs';
16
16
  import '../../chunk-TGP5M5R7.mjs';
17
+ import '../../chunk-U2BKYEC7.mjs';
17
18
  import '../../chunk-Y2F66IQJ.mjs';
18
19
  import '../../chunk-ZJ4CSAB2.mjs';
19
20
  import '../../chunk-QZN3MIJ3.mjs';
20
21
  import '../../chunk-T6CNO72J.mjs';
21
22
  import '../../chunk-WQBCBKY3.mjs';
22
- import '../../chunk-A3UB2MXL.mjs';
23
+ import '../../chunk-5ER245FI.mjs';
23
24
  import '../../chunk-CVQWQVFX.mjs';
24
25
  import '../../chunk-FGMGUDHX.mjs';
25
26
  import '../../chunk-KEHK2O6P.mjs';
26
27
  import '../../chunk-GES7U2PM.mjs';
27
28
  import '../../chunk-BVOJIYRV.mjs';
28
- import '../../chunk-U2BKYEC7.mjs';
29
+ import '../../chunk-NVL4ZR3K.mjs';
30
+ import '../../chunk-X5CV2E2B.mjs';
31
+ import '../../chunk-7X5JST5L.mjs';
32
+ import '../../chunk-ZIJ63TBT.mjs';
29
33
  import '../../chunk-R6A773WK.mjs';
30
34
  import '../../chunk-YTJCGKM4.mjs';
31
- import '../../chunk-YRX6XMOQ.mjs';
35
+ import '../../chunk-R6PR4WYZ.mjs';
32
36
  import '../../chunk-R7OSDAFK.mjs';
33
37
  import '../../chunk-L5ORED7V.mjs';
34
38
  import '../../chunk-TPJU7NDJ.mjs';
package/dist/react.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { N as NarsilError, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, Q as QueryParams, j as PreflightResult, e as QueryResult, k as SuggestParams, l as SuggestResult } from './memory-CV9NAxLY.js';
2
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-CV9NAxLY.js';
3
- import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-BGaZJyoY.js';
4
- export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-BGaZJyoY.js';
1
+ import { N as NarsilError, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, Q as QueryParams, j as PreflightResult, e as QueryResult, k as SuggestParams, l as SuggestResult } from './memory-dd3GESdc.js';
2
+ export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-dd3GESdc.js';
3
+ import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-DA1Ff0G4.js';
4
+ export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-DA1Ff0G4.js';
5
5
  import { ReactNode, ReactElement } from 'react';
6
- import { N as Narsil } from './engine-9X6W5naj.js';
7
- import { N as NarsilClient, I as ImportSource } from './client-BMK53IR2.js';
8
- import { A as AnyDocument } from './schema-DtsgmNfU.js';
6
+ import { N as Narsil } from './engine-96_kLtSY.js';
7
+ import { N as NarsilClient, I as ImportSource } from './client-Cc42b42j.js';
8
+ import { A as AnyDocument } from './schema-DttzM-ln.js';
9
+ import './synonyms-CpOAHPa-.js';
9
10
  import './adapters-79OIa4xm.js';
10
11
 
11
12
  /**
@@ -1,4 +1,5 @@
1
1
  import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
+ import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
2
3
 
3
4
  /**
4
5
  * A document as the engine stores it: any set of fields, with an optional `id`.
@@ -231,6 +232,17 @@ interface IndexConfig {
231
232
  * `CONFIG_INVALID`.
232
233
  */
233
234
  patternValueLimit?: number;
235
+ /**
236
+ * A search for any word in a rule of this set also matches the synonyms
237
+ * that the rule gives that word, and a document that holds a synonym scores
238
+ * as though it held the word itself. The engine analyses each word with the
239
+ * index's language, tokeniser, and stop words, so a word must analyse to
240
+ * exactly one token. {@link Narsil.createIndex} throws `CONFIG_INVALID` for
241
+ * a stop word, a phrase, a word that holds a control character, or a set
242
+ * beyond 100,000 rules, 500,000 words, or 4,194,304 bytes of words in UTF-8.
243
+ * {@link SynonymOperations.updateSynonyms} replaces the set without a rebuild.
244
+ */
245
+ synonyms?: SynonymRule[];
234
246
  }
235
247
  /**
236
248
  * BM25 tuning for an index.
package/dist/server.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-CV9NAxLY.js';
2
- import { b as ServerOptions, N as NarsilServer } from './capabilities-SJPttcgQ.js';
3
- export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, c as RequestContext, d as RequestDenial, S as SERVER_CAPABILITIES, e as ServerLimits, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-SJPttcgQ.js';
4
- import { N as Narsil } from './engine-9X6W5naj.js';
5
- import { d as TaskProgress, b as ImportResult, h as TaskStore, e as TaskRecord } from './tasks-BGaZJyoY.js';
6
- export { C as CapabilitiesResponse, a as CreateIndexEmbedding, i as CreateIndexRequest, H as HttpIndexConfig, I as ImportError, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, f as TaskStatus, g as TaskType } from './tasks-BGaZJyoY.js';
7
- import './schema-DtsgmNfU.js';
1
+ export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-dd3GESdc.js';
2
+ import { c as ServerOptions, N as NarsilServer } from './capabilities-CvExBThq.js';
3
+ export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, d as RequestContext, e as RequestDenial, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, f as ServerLimits, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-CvExBThq.js';
4
+ import { N as Narsil } from './engine-96_kLtSY.js';
5
+ import { d as TaskProgress, b as ImportResult, h as TaskStore, e as TaskRecord } from './tasks-DA1Ff0G4.js';
6
+ export { C as CapabilitiesResponse, a as CreateIndexEmbedding, i as CreateIndexRequest, H as HttpIndexConfig, I as ImportError, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, f as TaskStatus, g as TaskType } from './tasks-DA1Ff0G4.js';
7
+ import './schema-DttzM-ln.js';
8
8
  import './adapters-79OIa4xm.js';
9
- import './config-UJx1dyX1.js';
10
- import './config-BUR-7eVQ.js';
11
- import './index-vCMu8OeQ.js';
9
+ import './synonyms-CpOAHPa-.js';
10
+ import './config-DyRowvVP.js';
11
+ import './config-BYne-yCI.js';
12
+ import './index-ONAEaqtx.js';
12
13
  import './types-Cb9kiY5P.js';
13
14
 
14
15
  /**