@delali/narsil 0.3.1-next.130 → 0.3.1-next.140
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/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/analysis-change-JN23AZQP.mjs +43 -0
- package/dist/analysis-change-entry-5JSIMEKG.mjs +1 -0
- package/dist/browser/analysis-change-57MIRJWR.mjs +499 -0
- package/dist/browser/analysis-change-entry-ICGRR3IN.mjs +1 -0
- package/dist/browser/{chunk-UDGB2MWT.mjs → chunk-35B42UFM.mjs} +4 -0
- package/dist/browser/{chunk-VBBLTD7O.mjs → chunk-3EYDURFD.mjs} +39 -27
- package/dist/browser/{chunk-AIIJDWMG.mjs → chunk-4MFH226Q.mjs} +1 -1
- package/dist/browser/{chunk-D7WQF6DV.mjs → chunk-5LYWZJE2.mjs} +2 -2
- package/dist/browser/chunk-67KSBUYR.mjs +173 -0
- package/dist/browser/{chunk-M5UAAXGU.mjs → chunk-6BSB4N6B.mjs} +2 -2
- package/dist/browser/{chunk-NSCSR6MA.mjs → chunk-CGVBGHBX.mjs} +81 -6
- package/dist/browser/chunk-E5SFTOQR.mjs +21 -0
- package/dist/browser/{chunk-VEGHFP2P.mjs → chunk-MZI3TEOW.mjs} +4 -2
- package/dist/browser/chunk-OIZS5KIX.mjs +6 -0
- package/dist/browser/chunk-QHNNULPW.mjs +265 -0
- package/dist/browser/chunk-XVMOQQ34.mjs +384 -0
- package/dist/browser/{chunk-2Y3CO4EQ.mjs → chunk-ZAIZQOTM.mjs} +256 -777
- package/dist/browser/{durability-wiring-FNZSRH4N.mjs → durability-wiring-MTIAN6VT.mjs} +145 -50
- package/dist/browser/import-Q7MXD6BS.mjs +8 -0
- package/dist/browser/{module-4HIMOQM5.mjs → module-5J3PEUEB.mjs} +7 -6
- package/dist/browser/{phrase-module-WESYVU7K.mjs → phrase-module-HGVBO24W.mjs} +1 -1
- package/dist/{restore-queue-JAMNRC6T.mjs → browser/restore-queue-DISFECE4.mjs} +8 -2
- package/dist/browser/{runtime-3X7ZJ5T3.mjs → runtime-VEUH674B.mjs} +2 -2
- package/dist/browser/{snapshot-V7VF6BN6.mjs → snapshot-YBJ5MF2M.mjs} +36 -167
- package/dist/browser/{write-YIC2MKRY.mjs → write-RTWI5MXL.mjs} +8 -6
- package/dist/{capabilities-Bl8G9taj.d.ts → capabilities-DXAmysqJ.d.ts} +11 -11
- package/dist/{chunk-NMXRXFGZ.mjs → chunk-4GCN34JV.mjs} +2 -2
- package/dist/{chunk-SOHMMNCH.mjs → chunk-6VHWXAOI.mjs} +4 -4
- package/dist/{chunk-2C3WXBQS.mjs → chunk-74XB2SXI.mjs} +1 -1
- package/dist/{chunk-QQTXT65X.mjs → chunk-B5I3IL4H.mjs} +12 -7
- package/dist/chunk-BDIDUW2B.mjs +387 -0
- package/dist/{chunk-5LX6MOIB.mjs → chunk-C3YDYX6C.mjs} +1 -1
- package/dist/{chunk-Y4BVTQ53.mjs → chunk-CCCGEPJM.mjs} +2 -2
- package/dist/{chunk-2JWNJSNE.mjs → chunk-CPCGEIOM.mjs} +11 -8
- package/dist/chunk-CZQ33DLW.mjs +78 -0
- package/dist/{chunk-4GDLFDPZ.mjs → chunk-DD2673TX.mjs} +3 -2
- package/dist/{chunk-RNSC4NFI.mjs → chunk-EEBCDP36.mjs} +3 -1
- package/dist/{chunk-HCGJKDZV.mjs → chunk-FFVLPCLH.mjs} +1 -1
- package/dist/{chunk-WVRDRLIC.mjs → chunk-FKARMUWH.mjs} +6 -6
- package/dist/{chunk-PATMDIMN.mjs → chunk-HJJWY6PT.mjs} +1 -1
- package/dist/chunk-HMDT3I63.mjs +21 -0
- package/dist/{chunk-CZ7ISLXA.mjs → chunk-HNHCNTVG.mjs} +4 -0
- package/dist/{chunk-RWESFSJI.mjs → chunk-IBATGS3J.mjs} +87 -61
- package/dist/{chunk-Y2U5VVWX.mjs → chunk-ICW45TTU.mjs} +1 -1
- package/dist/{chunk-T4OFG4IQ.mjs → chunk-IP4HJOGC.mjs} +90 -16
- package/dist/{chunk-EUCX5K74.mjs → chunk-J3EHATEZ.mjs} +3 -3
- package/dist/{chunk-X5CNUKD5.mjs → chunk-K3AQOZVM.mjs} +37 -20
- package/dist/chunk-LK3MOTXF.mjs +174 -0
- package/dist/{chunk-7OIQ2SIO.mjs → chunk-LLDFIKGP.mjs} +4 -4
- package/dist/{chunk-K77FJXKS.mjs → chunk-MTQTX4BP.mjs} +81 -8
- package/dist/{chunk-ZR4VM4A6.mjs → chunk-N37VMC62.mjs} +1 -18
- package/dist/{chunk-2WBY4Y4M.mjs → chunk-NOT5QOHU.mjs} +1 -1
- package/dist/{chunk-D5TFRB5G.mjs → chunk-NPNK57CA.mjs} +1 -1
- package/dist/{chunk-6SSVIW7Y.mjs → chunk-O4LJQI4G.mjs} +31 -5
- package/dist/{chunk-JJ6EUMXB.mjs → chunk-PNNVTKMT.mjs} +2 -2
- package/dist/{chunk-2SEL6SBS.mjs → chunk-RKAVHNRW.mjs} +2 -2
- package/dist/{chunk-XABMCBHA.mjs → chunk-SBMAWTRG.mjs} +684 -99
- package/dist/chunk-TCWQJL7O.mjs +188 -0
- package/dist/{chunk-2MKX2SCO.mjs → chunk-U4X4AWKL.mjs} +7 -7
- package/dist/{chunk-PU6SKH7O.mjs → chunk-UBXJQJII.mjs} +2 -2
- package/dist/chunk-UEV53BBO.mjs +480 -0
- package/dist/{chunk-NNO7CO3A.mjs → chunk-UIKN2OTQ.mjs} +1 -1
- package/dist/{chunk-F6AAXI7T.mjs → chunk-VSUYTPME.mjs} +3 -3
- package/dist/{chunk-TGHNXN7W.mjs → chunk-W2XDK66Z.mjs} +180 -541
- package/dist/{chunk-7X5JST5L.mjs → chunk-WNBRW4Q2.mjs} +16 -2
- package/dist/{chunk-6M6SDH3S.mjs → chunk-XMQNOD5V.mjs} +8 -8
- package/dist/{chunk-SZGRYEIC.mjs → chunk-XS2VM7UE.mjs} +3 -3
- package/dist/{chunk-JT3YZGCE.mjs → chunk-XXKWEG53.mjs} +3 -188
- package/dist/{chunk-YBWSV5DV.mjs → chunk-ZMBFWQXN.mjs} +2 -2
- package/dist/{chunk-7XY6VD7B.mjs → chunk-ZSWHPKGM.mjs} +1 -1
- package/dist/{client-Cx-TiqPE.d.ts → client-DApBeLbk.d.ts} +18 -3
- package/dist/client.d.ts +7 -8
- package/dist/client.mjs +11 -1
- package/dist/{events-DErop1LM.d.ts → config-B0H-vp4U.d.ts} +424 -2
- package/dist/{config-CzB9YvF_.d.ts → config-Brysl9NO.d.ts} +3 -3
- package/dist/{direct-executor-HQ4QVDX7.mjs → direct-executor-J5UDLPL3.mjs} +14 -14
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +24 -9
- package/dist/distribution.mjs +882 -192
- package/dist/{durability-wiring-S7OX2MAI.mjs → durability-wiring-AYOTAPNQ.mjs} +165 -70
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-B_W9sdZK.d.ts → engine-CuLMbH1-.d.ts} +64 -7
- package/dist/import-QRZAQ5RH.mjs +43 -0
- package/dist/{index-CKI1fDEl.d.ts → index-HYnqS1SE.d.ts} +2 -2
- package/dist/index.browser.mjs +4 -4
- package/dist/index.d.ts +6 -7
- package/dist/index.mjs +20 -20
- package/dist/{long-query-thread-WVSMIBYP.mjs → long-query-thread-U7K5A72G.mjs} +14 -14
- package/dist/{module-2E4XYSGT.mjs → module-L2OZO5PQ.mjs} +11 -11
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +12 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +23 -23
- package/dist/{phrase-module-JERF2IDG.mjs → phrase-module-5QHBD2VJ.mjs} +1 -1
- package/dist/react.d.ts +11 -8
- package/dist/react.mjs +4 -0
- package/dist/{rerank-DMMT4FZA.mjs → rerank-KTLC3E6N.mjs} +5 -5
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{browser/restore-queue-GEZ54CA5.mjs → restore-queue-RYSRRFS4.mjs} +8 -2
- package/dist/{runtime-7MLQ7J64.mjs → runtime-DYV75DCB.mjs} +6 -6
- package/dist/{schema-CS-clLun.d.ts → schema-BTXbHCqA.d.ts} +4 -1
- package/dist/server.d.ts +200 -11
- package/dist/server.mjs +66 -23
- package/dist/{snapshot-DOQLGGEX.mjs → snapshot-BTRZ3MZK.mjs} +59 -190
- package/dist/synonyms.mjs +6 -4
- package/dist/tasks-DjGjK70Y.d.ts +720 -0
- package/dist/{thread-DNK5XWXG.mjs → thread-USB3GOPY.mjs} +13 -13
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-ZKR7SNRT.mjs → write-GHTA56OW.mjs} +25 -22
- package/openapi.json +5310 -0
- package/package.json +16 -8
- package/dist/config-hOWGBeC6.d.ts +0 -414
- package/dist/tasks-BfF-VRhm.d.ts +0 -302
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-
|
|
2
|
-
import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-
|
|
3
|
-
import { decodeSegmentManifest, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope,
|
|
4
|
-
import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-
|
|
1
|
+
import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-PNNVTKMT.mjs';
|
|
2
|
+
import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-VSUYTPME.mjs';
|
|
3
|
+
import { decodeSegmentManifest, metadataFromConfig, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope, createSeqOwner, readSegmentManifest, writeMetadataEnvelope, reclaimUnlistedKeys, loadSegmentedCheckpoint, isRecord, invalidManifest, unpackEnvelopeBytes, isId, isUint32, isSequenceNumber, writeLiveVectors, growPartitionsTo, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf, durableMetadataConfigOf, readCurrentManifest } from './chunk-MTQTX4BP.mjs';
|
|
4
|
+
import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-ICW45TTU.mjs';
|
|
5
5
|
import './chunk-37CD3OKS.mjs';
|
|
6
|
-
import { createDurableDirectory } from './chunk-
|
|
6
|
+
import { createDurableDirectory } from './chunk-4GCN34JV.mjs';
|
|
7
7
|
import { spawnNodeWorker } from './chunk-W55X2BYN.mjs';
|
|
8
8
|
import { getFs } from './chunk-HLPRHOSO.mjs';
|
|
9
|
-
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, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
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, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-CPCGEIOM.mjs';
|
|
10
|
+
import './chunk-LLDFIKGP.mjs';
|
|
11
11
|
import './chunk-P36MUFEJ.mjs';
|
|
12
12
|
import './chunk-YH5OIL7B.mjs';
|
|
13
|
-
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
import { resolveWorkerEntry } from './chunk-
|
|
13
|
+
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-W2XDK66Z.mjs';
|
|
14
|
+
import './chunk-XMQNOD5V.mjs';
|
|
15
|
+
import './chunk-XXKWEG53.mjs';
|
|
16
|
+
import { resolveWorkerEntry } from './chunk-UIKN2OTQ.mjs';
|
|
17
17
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
18
|
-
import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-
|
|
19
|
-
import { fnv1a } from './chunk-
|
|
20
|
-
import './chunk-
|
|
18
|
+
import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-IBATGS3J.mjs';
|
|
19
|
+
import { fnv1a } from './chunk-U4X4AWKL.mjs';
|
|
20
|
+
import './chunk-N37VMC62.mjs';
|
|
21
21
|
import './chunk-ZATRDAYU.mjs';
|
|
22
22
|
import './chunk-EBIHRL7B.mjs';
|
|
23
23
|
import './chunk-HJSN7UYG.mjs';
|
|
24
|
-
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-
|
|
25
|
-
import './chunk-TGP5M5R7.mjs';
|
|
26
|
-
import './chunk-U2BKYEC7.mjs';
|
|
24
|
+
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-EEBCDP36.mjs';
|
|
27
25
|
import './chunk-KOKM4PQN.mjs';
|
|
28
26
|
import './chunk-QSK35UC2.mjs';
|
|
29
|
-
import './chunk-
|
|
30
|
-
import './chunk-
|
|
27
|
+
import './chunk-74XB2SXI.mjs';
|
|
28
|
+
import './chunk-RKAVHNRW.mjs';
|
|
31
29
|
import './chunk-WQBCBKY3.mjs';
|
|
32
30
|
import './chunk-JUKYYXSP.mjs';
|
|
33
|
-
import './chunk-
|
|
34
|
-
import { encodeDocument, requireValidFieldTypes } from './chunk-
|
|
31
|
+
import './chunk-J3EHATEZ.mjs';
|
|
32
|
+
import { encodeDocument, requireValidFieldTypes } from './chunk-UBXJQJII.mjs';
|
|
35
33
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
36
34
|
import './chunk-FQBFZAWG.mjs';
|
|
37
35
|
import { MIN_M } from './chunk-VJS4JFBQ.mjs';
|
|
38
36
|
import './chunk-GES7U2PM.mjs';
|
|
39
|
-
import './chunk-
|
|
40
|
-
import './chunk-
|
|
37
|
+
import './chunk-ZSWHPKGM.mjs';
|
|
38
|
+
import './chunk-O4LJQI4G.mjs';
|
|
41
39
|
import './chunk-X5CV2E2B.mjs';
|
|
42
|
-
import './chunk-
|
|
43
|
-
import './chunk-
|
|
40
|
+
import './chunk-WNBRW4Q2.mjs';
|
|
41
|
+
import './chunk-TGP5M5R7.mjs';
|
|
42
|
+
import './chunk-U2BKYEC7.mjs';
|
|
43
|
+
import './chunk-NPNK57CA.mjs';
|
|
44
44
|
import './chunk-4UMZ7KQL.mjs';
|
|
45
45
|
import './chunk-R6A773WK.mjs';
|
|
46
46
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
47
47
|
import './chunk-UJWGQIXU.mjs';
|
|
48
|
-
import './chunk-
|
|
48
|
+
import './chunk-FFVLPCLH.mjs';
|
|
49
49
|
import './chunk-22YPZVMG.mjs';
|
|
50
50
|
import './chunk-RFBLQLLZ.mjs';
|
|
51
51
|
import './chunk-L5ORED7V.mjs';
|
|
52
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
52
|
+
import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
|
|
53
53
|
import { decode } from '@msgpack/msgpack';
|
|
54
54
|
|
|
55
55
|
// src/persistence/durability/sha256.ts
|
|
@@ -1016,10 +1016,11 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1016
1016
|
if (manager === void 0) {
|
|
1017
1017
|
return 0;
|
|
1018
1018
|
}
|
|
1019
|
-
const metadata = input.hooks.
|
|
1019
|
+
const metadata = input.hooks.buildTermsMetadata(input.indexName);
|
|
1020
1020
|
if (metadata === void 0) {
|
|
1021
1021
|
return 0;
|
|
1022
1022
|
}
|
|
1023
|
+
const fromMemory = input.fromMemory || input.hooks.mustRewriteTerms(input.indexName);
|
|
1023
1024
|
const vectorIndexes = input.hooks.getVectorIndexes(input.indexName);
|
|
1024
1025
|
const store = directoryCheckpointStore(input.directory);
|
|
1025
1026
|
const writeRecords = input.hooks.writeRecords ?? null;
|
|
@@ -1032,13 +1033,13 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1032
1033
|
wholePartitionsWhereMostChanged(manager, {
|
|
1033
1034
|
priorCheckpoint: priorManifest?.checkpoint ?? [],
|
|
1034
1035
|
priorPartitionIds: (priorManifest?.partitions ?? []).map((partition) => partition.partitionId),
|
|
1035
|
-
everyPartition:
|
|
1036
|
+
everyPartition: fromMemory,
|
|
1036
1037
|
aWorkerCanSerialise: input.canOffload && checkpointWorkerIsUsable(),
|
|
1037
1038
|
...writeRecords === null ? {} : {
|
|
1038
1039
|
captureRecords: (partitionId) => (segments2) => writeRecords.captureSegments(indexName, partitionId, segments2)
|
|
1039
1040
|
}
|
|
1040
1041
|
}),
|
|
1041
|
-
|
|
1042
|
+
fromMemory ? void 0 : priorManifest?.checkpoint ?? [],
|
|
1042
1043
|
priorManifest?.vectors ?? [],
|
|
1043
1044
|
writeRecords === null ? void 0 : (partitionId, lastSeqNo) => writeRecords.termHistoryOf(indexName, partitionId, lastSeqNo)
|
|
1044
1045
|
);
|
|
@@ -1046,7 +1047,7 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1046
1047
|
await makeEveryAppliedMutationDurable(input.indexState, input.failPartition);
|
|
1047
1048
|
if (aTargetFailed(input.indexState, targets)) return 0;
|
|
1048
1049
|
const [liveVectors, segments] = await bothOrTheFirstFailure(
|
|
1049
|
-
writeCapturedVectors(store, input.indexName, capture2, priorManifest,
|
|
1050
|
+
writeCapturedVectors(store, input.indexName, capture2, priorManifest, fromMemory),
|
|
1050
1051
|
writeIndexCheckpointSegments({
|
|
1051
1052
|
directory: input.directory,
|
|
1052
1053
|
metadata,
|
|
@@ -1062,6 +1063,7 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1062
1063
|
await makeEveryAppliedMutationDurable(input.indexState, input.failPartition);
|
|
1063
1064
|
if (aTargetFailed(input.indexState, targets)) return 0;
|
|
1064
1065
|
const written = await commitCheckpointManifest(store, metadata, segments, liveVectors.vectors);
|
|
1066
|
+
input.hooks.onManifestCommitted(input.indexName, metadata.analysisGeneration ?? 0);
|
|
1065
1067
|
recordWrittenVectors(vectorIndexes, liveVectors.written);
|
|
1066
1068
|
await adoptVectorLayouts(store, vectorIndexes, liveVectors.layouts);
|
|
1067
1069
|
if (!input.holdsCheckpointFiles()) {
|
|
@@ -1118,6 +1120,19 @@ function createIndexLoads(vectorIndexesOf2) {
|
|
|
1118
1120
|
startGraphRepairs
|
|
1119
1121
|
};
|
|
1120
1122
|
}
|
|
1123
|
+
async function switchInTurn(turns, turn) {
|
|
1124
|
+
let swapped = false;
|
|
1125
|
+
await checkpointInTurn(turns, {
|
|
1126
|
+
joinsInFlight: false,
|
|
1127
|
+
mayStart: turn.mayStart,
|
|
1128
|
+
perform: async () => {
|
|
1129
|
+
swapped = turn.swap();
|
|
1130
|
+
if (swapped) await turn.checkpoint();
|
|
1131
|
+
},
|
|
1132
|
+
afterSettling: turn.afterSettling
|
|
1133
|
+
});
|
|
1134
|
+
return swapped;
|
|
1135
|
+
}
|
|
1121
1136
|
async function checkpointInTurn(turns, turn) {
|
|
1122
1137
|
if (turn.joinsInFlight && turns.checkpointInFlight !== null) return turns.checkpointInFlight;
|
|
1123
1138
|
while (turns.checkpointInFlight !== null) await turns.checkpointInFlight.catch(() => void 0);
|
|
@@ -1421,6 +1436,19 @@ async function commitAppended(partition, address, deps) {
|
|
|
1421
1436
|
}
|
|
1422
1437
|
}
|
|
1423
1438
|
|
|
1439
|
+
// src/persistence/durability/mutation-entry.ts
|
|
1440
|
+
function buildMutationEntry(record, seqNo) {
|
|
1441
|
+
return buildEntry({
|
|
1442
|
+
seqNo,
|
|
1443
|
+
primaryTerm: SINGLE_NODE_PRIMARY_TERM,
|
|
1444
|
+
operation: record.operation,
|
|
1445
|
+
partitionId: record.partitionId,
|
|
1446
|
+
indexName: record.indexName,
|
|
1447
|
+
documentId: record.documentId,
|
|
1448
|
+
document: record.document
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1424
1452
|
// src/persistence/durability/partition-failure.ts
|
|
1425
1453
|
function createPartitionFailureRouting() {
|
|
1426
1454
|
let onFailed = null;
|
|
@@ -2458,6 +2486,45 @@ async function recoverCheckpoint(deps) {
|
|
|
2458
2486
|
return { checkpoint: await deps.replay(checkpoint), upgradedDocumentCount: null };
|
|
2459
2487
|
}
|
|
2460
2488
|
|
|
2489
|
+
// src/persistence/durability/stored-analysis.ts
|
|
2490
|
+
function generationOfStoredTerms(store, indexName) {
|
|
2491
|
+
return readSegmentManifest(store, indexName).then((decoded) => {
|
|
2492
|
+
if (decoded === null) return null;
|
|
2493
|
+
return decoded.kind === "current" ? decoded.manifest.analysisGeneration ?? 0 : 0;
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
function promotePendingAnalysis(metadata) {
|
|
2497
|
+
const pending = metadata.pendingAnalysis;
|
|
2498
|
+
if (pending === void 0) return;
|
|
2499
|
+
metadata.language = pending.language;
|
|
2500
|
+
metadata.analysisGeneration = pending.generation;
|
|
2501
|
+
metadata.analysisRevision = void 0;
|
|
2502
|
+
metadata.tokenizer = pending.tokenizer;
|
|
2503
|
+
metadata.stopWords = pending.stopWords;
|
|
2504
|
+
metadata.stopWordList = pending.stopWordList;
|
|
2505
|
+
metadata.pendingAnalysis = void 0;
|
|
2506
|
+
}
|
|
2507
|
+
async function settleStoredAnalysis(store, metadata, metadataOnly) {
|
|
2508
|
+
if (metadataOnly && metadata.pendingAnalysis === void 0) return false;
|
|
2509
|
+
const stored = await generationOfStoredTerms(store, metadata.indexName);
|
|
2510
|
+
const current = metadata.analysisGeneration ?? 0;
|
|
2511
|
+
if (stored === null || stored === current) return false;
|
|
2512
|
+
if (stored === metadata.pendingAnalysis?.generation) {
|
|
2513
|
+
promotePendingAnalysis(metadata);
|
|
2514
|
+
return true;
|
|
2515
|
+
}
|
|
2516
|
+
throw new NarsilError(
|
|
2517
|
+
ErrorCodes.CONFIG_INVALID,
|
|
2518
|
+
`The saved terms of index "${metadata.indexName}" come from analysis generation ${stored}, which matches no settings that its metadata records`,
|
|
2519
|
+
{
|
|
2520
|
+
indexName: metadata.indexName,
|
|
2521
|
+
storedGeneration: stored,
|
|
2522
|
+
currentGeneration: current,
|
|
2523
|
+
pendingGeneration: metadata.pendingAnalysis?.generation
|
|
2524
|
+
}
|
|
2525
|
+
);
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2461
2528
|
// src/persistence/durability/recover-index.ts
|
|
2462
2529
|
async function writeCountedMetadata(deps, indexName, documentCount) {
|
|
2463
2530
|
await deps.queueMetadataWrite(indexName, async () => {
|
|
@@ -2483,9 +2550,12 @@ async function recoverPersistedIndex(deps, indexName, metadataOnly) {
|
|
|
2483
2550
|
derivedCount = void 0;
|
|
2484
2551
|
}
|
|
2485
2552
|
}
|
|
2553
|
+
const promoted = await settleStoredAnalysis(store, metadata, metadataOnly);
|
|
2486
2554
|
await hooks.createIndexFromMetadata(metadata, !metadataOnly);
|
|
2487
2555
|
if (metadataOnly) {
|
|
2488
|
-
if (derivedCount !== void 0
|
|
2556
|
+
if (derivedCount !== void 0 || promoted) {
|
|
2557
|
+
await writeCountedMetadata(deps, indexName, derivedCount ?? metadata.documentCount ?? 0);
|
|
2558
|
+
}
|
|
2489
2559
|
return;
|
|
2490
2560
|
}
|
|
2491
2561
|
const manager = hooks.getManager(indexName);
|
|
@@ -2542,8 +2612,8 @@ async function recoverPersistedIndex(deps, indexName, metadataOnly) {
|
|
|
2542
2612
|
for (const { partitionId, lastSeqNo, primaryTerm } of recovered.checkpoint) {
|
|
2543
2613
|
deps.registerPartition(indexName, partitionId, lastSeqNo, primaryTerm);
|
|
2544
2614
|
}
|
|
2545
|
-
if (recovered.upgradedDocumentCount !== null) {
|
|
2546
|
-
await writeCountedMetadata(deps, indexName, recovered.upgradedDocumentCount);
|
|
2615
|
+
if (recovered.upgradedDocumentCount !== null || promoted) {
|
|
2616
|
+
await writeCountedMetadata(deps, indexName, recovered.upgradedDocumentCount ?? manager.countDocuments());
|
|
2547
2617
|
}
|
|
2548
2618
|
}
|
|
2549
2619
|
|
|
@@ -2632,17 +2702,6 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
2632
2702
|
}
|
|
2633
2703
|
}
|
|
2634
2704
|
}
|
|
2635
|
-
function buildMutationEntry(record, seqNo) {
|
|
2636
|
-
return buildEntry({
|
|
2637
|
-
seqNo,
|
|
2638
|
-
primaryTerm: SINGLE_NODE_PRIMARY_TERM,
|
|
2639
|
-
operation: record.operation,
|
|
2640
|
-
partitionId: record.partitionId,
|
|
2641
|
-
indexName: record.indexName,
|
|
2642
|
-
documentId: record.documentId,
|
|
2643
|
-
document: record.document
|
|
2644
|
-
});
|
|
2645
|
-
}
|
|
2646
2705
|
async function checkpointIndex(indexName, fromMemory = false, afterInFlight = fromMemory) {
|
|
2647
2706
|
const indexState = indexes.get(indexName);
|
|
2648
2707
|
if (indexState === void 0 || indexState.unloading || heldCheckpoints.holds(indexName, indexState)) return;
|
|
@@ -2799,6 +2858,16 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
2799
2858
|
checkpointFromMemory(indexName) {
|
|
2800
2859
|
return requestedCheckpoint(indexName, true);
|
|
2801
2860
|
},
|
|
2861
|
+
async checkpointAfterSwitch(indexName, swap) {
|
|
2862
|
+
const indexState = getOrCreateIndexState(indexName);
|
|
2863
|
+
heldCheckpoints.refuse(indexName, indexState);
|
|
2864
|
+
return switchInTurn(indexState, {
|
|
2865
|
+
mayStart: () => !indexState.unloading && !shuttingDown,
|
|
2866
|
+
swap,
|
|
2867
|
+
checkpoint: () => performCheckpoint(indexName, indexState, true),
|
|
2868
|
+
afterSettling: () => releaseStalledWrites(indexState)
|
|
2869
|
+
});
|
|
2870
|
+
},
|
|
2802
2871
|
async checkpointAfterInFlight(indexName) {
|
|
2803
2872
|
await loads.settled(indexName);
|
|
2804
2873
|
await checkpointIndex(indexName, false, true).catch((err) => markFatal(toError5(err)));
|
|
@@ -2911,6 +2980,17 @@ async function writeSnapshotOnlyCheckpoint(input) {
|
|
|
2911
2980
|
return captured.documentCount;
|
|
2912
2981
|
}
|
|
2913
2982
|
|
|
2983
|
+
// src/persistence/durability/snapshot-only/index-state.ts
|
|
2984
|
+
function createSnapshotIndexState() {
|
|
2985
|
+
return {
|
|
2986
|
+
mutationsSinceCheckpoint: 0,
|
|
2987
|
+
checkpointInFlight: null,
|
|
2988
|
+
applyChain: Promise.resolve(),
|
|
2989
|
+
unloading: false,
|
|
2990
|
+
appliedSeqNoByPartition: /* @__PURE__ */ new Map()
|
|
2991
|
+
};
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2914
2994
|
// src/persistence/durability/snapshot-only/restores.ts
|
|
2915
2995
|
function toError4(error) {
|
|
2916
2996
|
return error instanceof Error ? error : new Error(String(error));
|
|
@@ -2968,13 +3048,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
2968
3048
|
function getOrCreateIndexState(indexName) {
|
|
2969
3049
|
let state = indexes.get(indexName);
|
|
2970
3050
|
if (state === void 0) {
|
|
2971
|
-
state =
|
|
2972
|
-
mutationsSinceCheckpoint: 0,
|
|
2973
|
-
checkpointInFlight: null,
|
|
2974
|
-
applyChain: Promise.resolve(),
|
|
2975
|
-
unloading: false,
|
|
2976
|
-
appliedSeqNoByPartition: /* @__PURE__ */ new Map()
|
|
2977
|
-
};
|
|
3051
|
+
state = createSnapshotIndexState();
|
|
2978
3052
|
indexes.set(indexName, state);
|
|
2979
3053
|
}
|
|
2980
3054
|
return state;
|
|
@@ -3002,7 +3076,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3002
3076
|
async function performCheckpoint(indexName, indexState, fromMemory) {
|
|
3003
3077
|
await settleRestore(indexName);
|
|
3004
3078
|
const manager = hooks.getManager(indexName);
|
|
3005
|
-
const metadata = hooks.
|
|
3079
|
+
const metadata = hooks.buildTermsMetadata(indexName);
|
|
3006
3080
|
if (manager === void 0 || metadata === void 0) {
|
|
3007
3081
|
return;
|
|
3008
3082
|
}
|
|
@@ -3013,8 +3087,9 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3013
3087
|
manager,
|
|
3014
3088
|
vectorIndexes: hooks.getVectorIndexes(indexName),
|
|
3015
3089
|
appliedSeqNoByPartition: indexState.appliedSeqNoByPartition,
|
|
3016
|
-
rewritesEveryPartition: fromMemory
|
|
3090
|
+
rewritesEveryPartition: fromMemory || hooks.mustRewriteTerms(indexName)
|
|
3017
3091
|
});
|
|
3092
|
+
hooks.onManifestCommitted(indexName, metadata.analysisGeneration ?? 0);
|
|
3018
3093
|
await queueMetadataWrite(indexName, async () => {
|
|
3019
3094
|
const checkpointMetadata = hooks.buildMetadata(indexName, documentCount);
|
|
3020
3095
|
if (checkpointMetadata === void 0) return;
|
|
@@ -3050,6 +3125,11 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3050
3125
|
);
|
|
3051
3126
|
return queued;
|
|
3052
3127
|
}
|
|
3128
|
+
async function saveMetadata(indexName, documentCount) {
|
|
3129
|
+
const metadata = hooks.buildMetadata(indexName, documentCount);
|
|
3130
|
+
if (metadata === void 0) return;
|
|
3131
|
+
await adapter.save(metadataKey(indexName), await writeMetadataEnvelope(metadata, { checksum: true }));
|
|
3132
|
+
}
|
|
3053
3133
|
function recoverIndex(indexName, metadataOnly = false, startsGraphRepairs = true) {
|
|
3054
3134
|
return loads.track(indexName, loadIndex(indexName, metadataOnly), startsGraphRepairs);
|
|
3055
3135
|
}
|
|
@@ -3060,6 +3140,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3060
3140
|
return;
|
|
3061
3141
|
}
|
|
3062
3142
|
const { metadata } = await readMetadataEnvelope(metaBytes);
|
|
3143
|
+
const promoted = await settleStoredAnalysis(adapterCheckpointStore(adapter), metadata, metadataOnly);
|
|
3063
3144
|
let derivedCount;
|
|
3064
3145
|
if (metadataOnly && metadata.documentCount === void 0) {
|
|
3065
3146
|
try {
|
|
@@ -3071,15 +3152,9 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3071
3152
|
}
|
|
3072
3153
|
await hooks.createIndexFromMetadata(metadata, !metadataOnly);
|
|
3073
3154
|
if (metadataOnly) {
|
|
3074
|
-
if (derivedCount !== void 0) {
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
if (upgraded === void 0) {
|
|
3078
|
-
return;
|
|
3079
|
-
}
|
|
3080
|
-
const bytes = await writeMetadataEnvelope(upgraded, { checksum: true });
|
|
3081
|
-
await adapter.save(metadataKey(indexName), bytes);
|
|
3082
|
-
}).catch(() => void 0);
|
|
3155
|
+
if (derivedCount !== void 0 || promoted) {
|
|
3156
|
+
const counted = derivedCount ?? metadata.documentCount;
|
|
3157
|
+
await queueMetadataWrite(indexName, () => saveMetadata(indexName, counted)).catch(() => void 0);
|
|
3083
3158
|
}
|
|
3084
3159
|
return;
|
|
3085
3160
|
}
|
|
@@ -3107,13 +3182,9 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3107
3182
|
indexState.appliedSeqNoByPartition.set(partitionId, persistedSeqNo);
|
|
3108
3183
|
}
|
|
3109
3184
|
}
|
|
3110
|
-
if (recovered.upgradedDocumentCount !== null) {
|
|
3111
|
-
const upgradedCount = recovered.upgradedDocumentCount;
|
|
3112
|
-
await queueMetadataWrite(indexName,
|
|
3113
|
-
const upgraded = hooks.buildMetadata(indexName, upgradedCount);
|
|
3114
|
-
if (upgraded === void 0) return;
|
|
3115
|
-
await adapter.save(metadataKey(indexName), await writeMetadataEnvelope(upgraded, { checksum: true }));
|
|
3116
|
-
}).catch(() => void 0);
|
|
3185
|
+
if (recovered.upgradedDocumentCount !== null || promoted) {
|
|
3186
|
+
const upgradedCount = recovered.upgradedDocumentCount ?? manager.countDocuments();
|
|
3187
|
+
await queueMetadataWrite(indexName, () => saveMetadata(indexName, upgradedCount)).catch(() => void 0);
|
|
3117
3188
|
}
|
|
3118
3189
|
}
|
|
3119
3190
|
function countStoredBundleDocuments(indexName) {
|
|
@@ -3203,6 +3274,15 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
3203
3274
|
checkpointFromMemory(indexName) {
|
|
3204
3275
|
return checkpointIndex(indexName, true);
|
|
3205
3276
|
},
|
|
3277
|
+
async checkpointAfterSwitch(indexName, swap) {
|
|
3278
|
+
const indexState = getOrCreateIndexState(indexName);
|
|
3279
|
+
return switchInTurn(indexState, {
|
|
3280
|
+
mayStart: () => !indexState.unloading && !shuttingDown,
|
|
3281
|
+
swap,
|
|
3282
|
+
checkpoint: () => performCheckpoint(indexName, indexState, true),
|
|
3283
|
+
afterSettling: () => void 0
|
|
3284
|
+
});
|
|
3285
|
+
},
|
|
3206
3286
|
async checkpointAfterInFlight(indexName) {
|
|
3207
3287
|
await loads.settled(indexName);
|
|
3208
3288
|
await checkpointIndex(indexName, false, true).catch((err) => {
|
|
@@ -3277,6 +3357,12 @@ function createDurabilityIntegration(tier, hooks) {
|
|
|
3277
3357
|
getVectorFieldPaths: hooks.getVectorFieldPaths,
|
|
3278
3358
|
getVectorIndexes: hooks.getVectorIndexes,
|
|
3279
3359
|
buildMetadata: (indexName, documentCount) => buildMetadata(indexName, hooks, documentCount),
|
|
3360
|
+
buildTermsMetadata(indexName) {
|
|
3361
|
+
const config = hooks.getTermsConfig(indexName);
|
|
3362
|
+
return config === void 0 ? void 0 : metadataFromConfig(indexName, config, hooks.getManager(indexName)?.partitionCount);
|
|
3363
|
+
},
|
|
3364
|
+
mustRewriteTerms: hooks.mustRewriteTerms,
|
|
3365
|
+
onManifestCommitted: hooks.onManifestCommitted,
|
|
3280
3366
|
createIndexFromMetadata: hooks.createIndexFromMetadata,
|
|
3281
3367
|
recordCheckpoint: hooks.recordCheckpoint,
|
|
3282
3368
|
onLayoutUpgrade: hooks.onLayoutUpgrade,
|
|
@@ -3347,9 +3433,18 @@ function createDurabilityFromTier(tier, wiring) {
|
|
|
3347
3433
|
getVectorFieldPaths: (indexName) => wiring.indexRegistry.get(indexName)?.vectorFieldPaths ?? /* @__PURE__ */ new Set(),
|
|
3348
3434
|
getVectorIndexes: (indexName) => (wiring.indexRegistry.has(indexName) ? wiring.getManager(indexName)?.getVectorIndexes() : void 0) ?? /* @__PURE__ */ new Map(),
|
|
3349
3435
|
getIndexConfig: (indexName) => {
|
|
3436
|
+
const entry = wiring.indexRegistry.get(indexName);
|
|
3437
|
+
return entry === void 0 ? void 0 : durableMetadataConfigOf(entry);
|
|
3438
|
+
},
|
|
3439
|
+
getTermsConfig: (indexName) => {
|
|
3350
3440
|
const entry = wiring.indexRegistry.get(indexName);
|
|
3351
3441
|
return entry === void 0 ? void 0 : metadataConfigOf(entry);
|
|
3352
3442
|
},
|
|
3443
|
+
mustRewriteTerms: (indexName) => (wiring.indexRegistry.get(indexName)?.durableAnalysis ?? null) !== null,
|
|
3444
|
+
onManifestCommitted(indexName, analysisGeneration) {
|
|
3445
|
+
const entry = wiring.indexRegistry.get(indexName);
|
|
3446
|
+
if (entry !== void 0 && entry.analysisGeneration === analysisGeneration) entry.durableAnalysis = null;
|
|
3447
|
+
},
|
|
3353
3448
|
createIndexFromMetadata: wiring.createIndexFromMetadata,
|
|
3354
3449
|
recordCheckpoint: wiring.recordCheckpoint,
|
|
3355
3450
|
onLayoutUpgrade: wiring.emitLayoutUpgrade,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
1
|
+
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-NOT5QOHU.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from '../chunk-HNHCNTVG.mjs';
|
|
3
3
|
|
|
4
4
|
// src/embeddings/constants.ts
|
|
5
5
|
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
2
|
-
import { B as BM25Params, A as AnyDocument,
|
|
3
|
-
import { B as BatchResult, I as IndexInfo, k as IndexStats,
|
|
2
|
+
import { B as BM25Params, A as AnyDocument, I as InsertOptions, W as WriteOptions, a as IndexConfig, P as PartitionConfig } from './schema-BTXbHCqA.js';
|
|
3
|
+
import { B as BatchResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, L as ListParams, f as ListResult, Q as QueryParams, m as QueryResult, j as PreflightResult, g as SuggestParams, h as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, l as NarsilEventMap } from './config-B0H-vp4U.js';
|
|
4
4
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -33,6 +33,62 @@ interface AdapterRegistrationOperations {
|
|
|
33
33
|
registerRerankAdapter(name: string, adapter: RerankAdapter): void;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The analysis settings that {@link AnalysisOperations.changeAnalysis} changes
|
|
38
|
+
* on a live index. A key that you leave out keeps its current value.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
interface AnalysisChange {
|
|
43
|
+
/** This is the name of a registered language. */
|
|
44
|
+
language?: string;
|
|
45
|
+
/**
|
|
46
|
+
* This is a name that {@link registerTokenizer} bound. Pass `null` to return
|
|
47
|
+
* to the tokeniser of the language.
|
|
48
|
+
*/
|
|
49
|
+
tokenizer?: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* This is a name that {@link registerStopWords} bound, or a list of words.
|
|
52
|
+
* Pass `null` to return to the stop words of the language.
|
|
53
|
+
*/
|
|
54
|
+
stopWords?: string | readonly string[] | ReadonlySet<string> | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Changes how an index turns text into terms while the index keeps answering
|
|
58
|
+
* searches.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
interface AnalysisOperations {
|
|
63
|
+
/**
|
|
64
|
+
* Gives you an index that matches text under new settings, while the index
|
|
65
|
+
* keeps answering searches and accepting writes.
|
|
66
|
+
*
|
|
67
|
+
* The engine builds the new terms beside the old ones. Searches keep matching
|
|
68
|
+
* under the old settings during that time, while every write that the engine
|
|
69
|
+
* accepts reaches the new terms. Each search matches under one set of
|
|
70
|
+
* settings, either the old or the new, and the rebuild leaves vectors alone.
|
|
71
|
+
* The promise resolves once a durable checkpoint holds the new terms, or once
|
|
72
|
+
* the switch happens on an engine without durability. After a restart at any
|
|
73
|
+
* point, the engine goes on to finish the change.
|
|
74
|
+
*
|
|
75
|
+
* @param indexName - The index to change.
|
|
76
|
+
* @param change - The settings to change. A change to the values that the
|
|
77
|
+
* index already holds completes with no rebuild.
|
|
78
|
+
* @throws A `NarsilError` with `LANGUAGE_NOT_SUPPORTED` for an unregistered
|
|
79
|
+
* language, with `CONFIG_INVALID` for an unregistered name, a tokeniser
|
|
80
|
+
* instance, a stop word function, or a synonym word that breaks the synonym
|
|
81
|
+
* rules under the new settings, with `ANALYSIS_REBUILD_MEMORY_EXCEEDED` when a
|
|
82
|
+
* second copy of the terms does not fit in memory, with
|
|
83
|
+
* `ANALYSIS_CHANGE_REPLACED` when a later change or a restore replaces this
|
|
84
|
+
* one, with `ANALYSIS_CHANGE_NOT_READY` when the previous change has no
|
|
85
|
+
* durable checkpoint yet, with `PERSISTENCE_SAVE_FAILED` when the new terms
|
|
86
|
+
* answer searches before a durable checkpoint holds them, and with
|
|
87
|
+
* `PARTITION_REBALANCING_BACKPRESSURE` during a rebalance.
|
|
88
|
+
*/
|
|
89
|
+
changeAnalysis(indexName: string, change: AnalysisChange): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
|
|
36
92
|
/**
|
|
37
93
|
* Changes the BM25 setting of a live index, which
|
|
38
94
|
* {@link IndexConfig.bm25} sets when the index is created.
|
|
@@ -239,14 +295,15 @@ interface DocumentWriteOperations {
|
|
|
239
295
|
*
|
|
240
296
|
* One instance holds every index you create, so an application usually keeps a
|
|
241
297
|
* single engine for its lifetime and reaches each index by name. Build one
|
|
242
|
-
* with {@link createNarsil}. Its write, open and close, synonym, BM25,
|
|
243
|
-
* adapter registration methods come from {@link DocumentWriteOperations},
|
|
298
|
+
* with {@link createNarsil}. Its write, open and close, synonym, analysis, BM25,
|
|
299
|
+
* and adapter registration methods come from {@link DocumentWriteOperations},
|
|
244
300
|
* {@link IndexLifecycleOperations}, {@link SynonymOperations},
|
|
245
|
-
* {@link
|
|
301
|
+
* {@link AnalysisOperations}, {@link BM25Operations}, and
|
|
302
|
+
* {@link AdapterRegistrationOperations}.
|
|
246
303
|
*
|
|
247
304
|
* @public
|
|
248
305
|
*/
|
|
249
|
-
interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, BM25Operations, AdapterRegistrationOperations {
|
|
306
|
+
interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AnalysisOperations, BM25Operations, AdapterRegistrationOperations {
|
|
250
307
|
/**
|
|
251
308
|
* Creates an index you can insert documents into and query.
|
|
252
309
|
*
|
|
@@ -604,4 +661,4 @@ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, Syno
|
|
|
604
661
|
shutdown(): Promise<void>;
|
|
605
662
|
}
|
|
606
663
|
|
|
607
|
-
export type {
|
|
664
|
+
export type { AnalysisChange as A, BM25Operations as B, DocumentWriteOperations as D, IndexLifecycleOperations as I, Narsil as N, SynonymOperations as S, AdapterRegistrationOperations as a, AnalysisOperations as b, ByteSource as c };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { DOCUMENT_EXPORT_FORMAT, DOCUMENT_EXPORT_VERSION, readDocumentExport } from './chunk-BDIDUW2B.mjs';
|
|
2
|
+
import './chunk-CZQ33DLW.mjs';
|
|
3
|
+
import './chunk-TCWQJL7O.mjs';
|
|
4
|
+
import './chunk-W2XDK66Z.mjs';
|
|
5
|
+
import './chunk-XMQNOD5V.mjs';
|
|
6
|
+
import './chunk-XXKWEG53.mjs';
|
|
7
|
+
import './chunk-UIKN2OTQ.mjs';
|
|
8
|
+
import './chunk-AV4IJKD2.mjs';
|
|
9
|
+
import './chunk-IBATGS3J.mjs';
|
|
10
|
+
import './chunk-U4X4AWKL.mjs';
|
|
11
|
+
import './chunk-N37VMC62.mjs';
|
|
12
|
+
import './chunk-ZATRDAYU.mjs';
|
|
13
|
+
import './chunk-EBIHRL7B.mjs';
|
|
14
|
+
import './chunk-HJSN7UYG.mjs';
|
|
15
|
+
import './chunk-EEBCDP36.mjs';
|
|
16
|
+
import './chunk-KOKM4PQN.mjs';
|
|
17
|
+
import './chunk-QSK35UC2.mjs';
|
|
18
|
+
import './chunk-74XB2SXI.mjs';
|
|
19
|
+
import './chunk-RKAVHNRW.mjs';
|
|
20
|
+
import './chunk-WQBCBKY3.mjs';
|
|
21
|
+
import './chunk-JUKYYXSP.mjs';
|
|
22
|
+
import './chunk-J3EHATEZ.mjs';
|
|
23
|
+
import './chunk-UBXJQJII.mjs';
|
|
24
|
+
import './chunk-U476IXKQ.mjs';
|
|
25
|
+
import './chunk-FQBFZAWG.mjs';
|
|
26
|
+
import './chunk-VJS4JFBQ.mjs';
|
|
27
|
+
import './chunk-GES7U2PM.mjs';
|
|
28
|
+
import './chunk-ZSWHPKGM.mjs';
|
|
29
|
+
import './chunk-O4LJQI4G.mjs';
|
|
30
|
+
import './chunk-X5CV2E2B.mjs';
|
|
31
|
+
import './chunk-WNBRW4Q2.mjs';
|
|
32
|
+
import './chunk-TGP5M5R7.mjs';
|
|
33
|
+
import './chunk-U2BKYEC7.mjs';
|
|
34
|
+
import './chunk-NPNK57CA.mjs';
|
|
35
|
+
import './chunk-4UMZ7KQL.mjs';
|
|
36
|
+
import './chunk-R6A773WK.mjs';
|
|
37
|
+
import './chunk-YTJCGKM4.mjs';
|
|
38
|
+
import './chunk-UJWGQIXU.mjs';
|
|
39
|
+
import './chunk-FFVLPCLH.mjs';
|
|
40
|
+
import './chunk-22YPZVMG.mjs';
|
|
41
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
42
|
+
import './chunk-L5ORED7V.mjs';
|
|
43
|
+
import './chunk-HNHCNTVG.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SchemaDefinition } from './schema-
|
|
1
|
+
import { S as SchemaDefinition } from './schema-BTXbHCqA.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tells watchers that the stored metadata of an index changed.
|
|
@@ -516,4 +516,4 @@ interface ClusterCoordinator extends IndexMetadataWatch {
|
|
|
516
516
|
shutdown(): Promise<void>;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
export type { AllocationTable as A, ClusterCoordinator as C, IndexMetadataEvent as I, NodeRole as N, PartitionAssignment as P, RegistrationLease as R, SchemaEvent as S, UnassignedReason as U, NodeRegistration as a, NodeCapacity as b,
|
|
519
|
+
export type { AllocationTable as A, ClusterCoordinator as C, IndexMetadataEvent as I, NodeRole as N, PartitionAssignment as P, RegistrationLease as R, SchemaEvent as S, UnassignedReason as U, NodeRegistration as a, NodeCapacity as b, NodeMemoryReport as c, AllocationConstraints as d, AllocationEvent as e, IndexMetadataWatch as f, IndexPartitionBytes as g, NodeEvent as h, PartitionState as i };
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-ZAIZQOTM.mjs';
|
|
2
2
|
import './browser/chunk-26A5JFT2.mjs';
|
|
3
|
-
export { isSimdAvailable } from './browser/chunk-
|
|
3
|
+
export { isSimdAvailable } from './browser/chunk-4MFH226Q.mjs';
|
|
4
4
|
import './browser/chunk-JPTQZWJQ.mjs';
|
|
5
|
-
import './browser/chunk-
|
|
6
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-
|
|
5
|
+
import './browser/chunk-MZI3TEOW.mjs';
|
|
6
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-35B42UFM.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { b as StopWordOverride, C as CustomTokenizer } from './schema-
|
|
2
|
-
export { A as AnyDocument, c as BM25FieldParams, B as BM25Params, E as EmbeddingFieldConfig,
|
|
1
|
+
import { b as StopWordOverride, C as CustomTokenizer } from './schema-BTXbHCqA.js';
|
|
2
|
+
export { A as AnyDocument, c as BM25FieldParams, B as BM25Params, E as EmbeddingFieldConfig, d as FieldOptionChain, F as FieldType, a as IndexConfig, I as InsertOptions, P as PartitionConfig, S as SchemaDefinition, e as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, f as VectorQuantizationMode, g as VectorStorageMode, W as WriteOptions } from './schema-BTXbHCqA.js';
|
|
3
3
|
import { P as PartialWordSearch } from './partial-words-DTIHO8G4.js';
|
|
4
4
|
import { P as PatternSearch } from './pattern-Cledccbl.js';
|
|
5
5
|
import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export { A as AdapterRegistrationOperations, B as BM25Operations, a as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-B_W9sdZK.js';
|
|
9
|
+
import { e as NarsilConfig } from './config-B0H-vp4U.js';
|
|
10
|
+
export { A as AnalysisConfig, o as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, p as ComparisonFilter, D as DocumentImportResult, q as DocumentProjection, r as DurabilityConfig, E as ErrorCode, b as ErrorCodes, F as FacetConfig, s as FacetResult, t as FieldFilter, u as FilterExpression, v as GeoFilter, w as GeoPolygonFilter, x as GeoRadiusFilter, n as GroupConfig, y as GroupReducer, G as GroupResult, H as HeldCheckpointReport, z as HighlightConfig, J as HighlightMatch, K as Hit, O as HybridConfig, R as IndexContext, I as IndexInfo, T as IndexLifecycleConfig, k as IndexStats, U as InsertContext, L as ListParams, f as ListResult, W as ListedDocument, X as MainCopyQueries, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, Y as NarsilEventHandlers, l as NarsilEventMap, Z as NarsilPlugin, _ as PartitionContext, P as PartitionStatsResult, j as PreflightResult, $ as PresenceFilter, a0 as ProcessMemoryReport, a1 as QueryCoverage, Q as QueryParams, m as QueryResult, a2 as RemoveContext, a3 as RerankConfig, a4 as ScoreComponents, a5 as SearchContext, a6 as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, a7 as SortField, a8 as SortSpec, a9 as StaleAnalysis, aa as StringFilter, g as SuggestParams, h as SuggestResult, ab as TermMatchPolicy, ac as UpdateContext, V as VectorMaintenanceResult, ad as VectorQueryConfig, ae as WorkerConfig, af as WorkerContext, ag as WorkerCopyReport, i as isNarsilError } from './config-B0H-vp4U.js';
|
|
11
|
+
import { N as Narsil } from './engine-CuLMbH1-.js';
|
|
12
|
+
export { a as AdapterRegistrationOperations, A as AnalysisChange, b as AnalysisOperations, B as BM25Operations, c as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-CuLMbH1-.js';
|
|
14
13
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
15
14
|
|
|
16
15
|
/**
|