@delali/narsil 0.3.1-next.109 → 0.3.1-next.112
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/browser/{chunk-RYWURYTW.mjs → chunk-2CBQ2PCC.mjs} +1 -1
- package/dist/browser/{chunk-EQ7BQ6VZ.mjs → chunk-LJS6PREA.mjs} +1 -0
- package/dist/browser/{chunk-3RXEGUGO.mjs → chunk-O5IKTA27.mjs} +41 -4
- package/dist/browser/{chunk-Z2K5AGZL.mjs → chunk-OVY4RPDS.mjs} +3 -3
- package/dist/browser/{chunk-S7KNCVPU.mjs → chunk-P7C2S5JX.mjs} +2 -2
- package/dist/browser/{chunk-SCBBEQWD.mjs → chunk-UR5MNN53.mjs} +189 -51
- package/dist/browser/{chunk-XHRHOH2P.mjs → chunk-YRYBTRWB.mjs} +139 -28
- package/dist/browser/{durability-wiring-JJGE7MED.mjs → durability-wiring-CPEMDDK7.mjs} +48 -20
- package/dist/browser/{module-PCKQADMQ.mjs → module-DYKR4INA.mjs} +5 -5
- package/dist/browser/{restore-queue-2STSWU2E.mjs → restore-queue-2H4QDQV4.mjs} +1 -1
- package/dist/browser/{runtime-ARKW5NZX.mjs → runtime-FL5K4JOH.mjs} +1 -1
- package/dist/browser/{snapshot-3AZDQKNA.mjs → snapshot-ISZMBDCN.mjs} +27 -14
- package/dist/browser/{write-XXLMPT3Y.mjs → write-IABOLE4N.mjs} +5 -5
- package/dist/{capabilities-D4MUmjfe.d.ts → capabilities-ByaX8Arf.d.ts} +2 -2
- package/dist/{chunk-CYXLPFBG.mjs → chunk-2IFU7SXG.mjs} +123 -35
- package/dist/{chunk-FN75BCXC.mjs → chunk-2RAQKITH.mjs} +1 -1
- package/dist/{chunk-VIXXQEX6.mjs → chunk-3COL24MT.mjs} +43 -6
- package/dist/{chunk-ICZW4J3I.mjs → chunk-3RRATITJ.mjs} +21 -21
- package/dist/{chunk-SAZB7ZHT.mjs → chunk-542TD4BL.mjs} +1 -1
- package/dist/{chunk-C57FPCTL.mjs → chunk-5WEBVYOA.mjs} +182 -44
- package/dist/{chunk-YP23IAV5.mjs → chunk-63HFWQEA.mjs} +4 -3
- package/dist/{chunk-FV5CP3E2.mjs → chunk-6ODIY6ZB.mjs} +1 -1
- package/dist/{chunk-RQ7LOBLD.mjs → chunk-6PN3U6XW.mjs} +1 -1
- package/dist/{chunk-SYHS56F7.mjs → chunk-7CI34JAP.mjs} +26 -13
- package/dist/{chunk-IBJWO5PF.mjs → chunk-7ZZQNOIY.mjs} +1 -1
- package/dist/{chunk-H5465KUZ.mjs → chunk-BVOUSX3U.mjs} +4 -3
- package/dist/{chunk-AWZVJCCW.mjs → chunk-DG62H7OD.mjs} +2 -2
- package/dist/{chunk-LWQTFKRS.mjs → chunk-FUUP45IS.mjs} +1 -1
- package/dist/{chunk-HL2GAS5N.mjs → chunk-GLZI636G.mjs} +7 -7
- package/dist/{chunk-C55OFKU6.mjs → chunk-HNAP2KTG.mjs} +2 -2
- package/dist/{chunk-A2HWRBQE.mjs → chunk-IBTKJIV7.mjs} +2 -2
- package/dist/{chunk-PA5WZWLC.mjs → chunk-IM76DLA7.mjs} +2 -2
- package/dist/{chunk-5LP7OU6B.mjs → chunk-IR4KQ4WB.mjs} +2 -2
- package/dist/{chunk-FABI2JA7.mjs → chunk-J6YVB2XM.mjs} +1 -1
- package/dist/{chunk-62GK7UUS.mjs → chunk-KCQG2PJT.mjs} +3 -3
- package/dist/{chunk-U6FT7LKG.mjs → chunk-LOBYK2FG.mjs} +3 -3
- package/dist/{chunk-XY6Z7T5W.mjs → chunk-N57XXGPG.mjs} +2 -2
- package/dist/{chunk-S2CKO6PP.mjs → chunk-OBWUWZRA.mjs} +1 -0
- package/dist/{chunk-CKRP7GCS.mjs → chunk-OCB7TMUQ.mjs} +1 -1
- package/dist/{chunk-NYWUBTMH.mjs → chunk-OFYKBKKV.mjs} +1 -1
- package/dist/{chunk-ZBZRBM2Z.mjs → chunk-PT7VRWS7.mjs} +3 -3
- package/dist/{chunk-DUWYU4D5.mjs → chunk-PWIWSUCX.mjs} +2 -2
- package/dist/{chunk-5W7ADHK7.mjs → chunk-QI6JW4PM.mjs} +1 -1
- package/dist/{chunk-SD2EYVU4.mjs → chunk-QIFOXLWF.mjs} +2 -2
- package/dist/{chunk-N75MAOM7.mjs → chunk-R2MRGYU5.mjs} +2 -2
- package/dist/{chunk-5DPTHLMX.mjs → chunk-V7G627TA.mjs} +1 -1
- package/dist/{chunk-4GD43FSW.mjs → chunk-V7ISFBFC.mjs} +10 -10
- package/dist/{chunk-MVWWAHTR.mjs → chunk-VK45J47R.mjs} +1 -1
- package/dist/{chunk-RSSLOFRP.mjs → chunk-VLRT47GU.mjs} +39 -8
- package/dist/{chunk-RPIE4QCL.mjs → chunk-YH5OIL7B.mjs} +2 -0
- package/dist/{chunk-JKOBHB4A.mjs → chunk-YIDSHBQS.mjs} +2 -2
- package/dist/{client-Ba9yP-Rr.d.ts → client-BdnzDFtO.d.ts} +2 -2
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +1 -0
- package/dist/{config-C-xXz8bC.d.ts → config-CSgvApt0.d.ts} +1 -1
- package/dist/{config-Dc_8-byz.d.ts → config-ujZESkJz.d.ts} +1 -1
- package/dist/{direct-executor-QH2M6AK2.mjs → direct-executor-ZSTKRA6Z.mjs} +11 -11
- package/dist/distribution/coordinator/etcd.mjs +94 -5
- package/dist/distribution/transport/grpc.mjs +24 -8
- package/dist/distribution/transport/in-memory.mjs +4 -4
- package/dist/distribution/transport/tcp.mjs +6 -6
- package/dist/distribution.d.ts +5 -5
- package/dist/distribution.mjs +1232 -377
- package/dist/{durability-wiring-4HWX7OVP.mjs → durability-wiring-EQTFL3B4.mjs} +65 -38
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CMZ5XSLy.d.ts → engine-C_HSy3iz.d.ts} +1 -1
- package/dist/{events-dnvgprIl.d.ts → events-CJsXF1F9.d.ts} +1 -0
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +16 -16
- package/dist/{module-IYILOTU3.mjs → module-WP4VVGV2.mjs} +9 -9
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +12 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +25 -23
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +1 -0
- package/dist/{rerank-EHJVXEDP.mjs → rerank-3POMPQNX.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{restore-queue-BONSQWCI.mjs → restore-queue-WZTMTJP2.mjs} +1 -1
- package/dist/{runtime-LEX2F7OW.mjs → runtime-C2435MPK.mjs} +5 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +12 -12
- package/dist/{snapshot-DWDLN5YW.mjs → snapshot-EU6NNB2P.mjs} +25 -25
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-B4B2cMK5.d.ts → tasks-CI3Fvkxw.d.ts} +1 -1
- package/dist/{thread-I32PUURR.mjs → thread-WGBCVJII.mjs} +11 -11
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +5 -5
- package/dist/{write-AOFSHACR.mjs → write-CKRWS3P5.mjs} +18 -18
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
2
|
-
import { C as ClusterNamespace } from './config-
|
|
3
|
-
import { h as TaskStore } from './tasks-
|
|
2
|
+
import { C as ClusterNamespace } from './config-ujZESkJz.js';
|
|
3
|
+
import { h as TaskStore } from './tasks-CI3Fvkxw.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Context handed to {@link OnRequestHook} for every inbound request, captured
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-
|
|
1
|
+
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes, uint64Bytes } from './chunk-3COL24MT.mjs';
|
|
2
2
|
import { WIRE_BATCH_BUDGET } from './chunk-P36MUFEJ.mjs';
|
|
3
|
-
import { ReplicationMessageTypes } from './chunk-
|
|
4
|
-
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-
|
|
5
|
-
import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, selectionKeeps, decodeMapWithoutFields, shareSegmentArrays, segmentArraysOf, mergeSegmentContents } from './chunk-
|
|
6
|
-
import { fnv1a, isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-
|
|
7
|
-
import { generateId, getLanguage } from './chunk-
|
|
8
|
-
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-
|
|
3
|
+
import { ReplicationMessageTypes } from './chunk-YH5OIL7B.mjs';
|
|
4
|
+
import { packChecksummedEnvelope, crc32, openChecksummedEnvelope, reconstructSchemaFromMetadata, HEADER_SIZE, prepareDocumentVectors } from './chunk-3RRATITJ.mjs';
|
|
5
|
+
import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, selectionKeeps, decodeMapWithoutFields, shareSegmentArrays, segmentArraysOf, mergeSegmentContents } from './chunk-V7ISFBFC.mjs';
|
|
6
|
+
import { fnv1a, isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-5WEBVYOA.mjs';
|
|
7
|
+
import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
|
|
8
|
+
import { extractVectorFieldsFromSchema, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-DG62H7OD.mjs';
|
|
9
9
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
10
|
-
import { resolveIndexAnalysis } from './chunk-
|
|
11
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
10
|
+
import { resolveIndexAnalysis } from './chunk-IR4KQ4WB.mjs';
|
|
11
|
+
import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
|
|
12
12
|
import { encode, decode } from '@msgpack/msgpack';
|
|
13
13
|
|
|
14
14
|
// src/persistence/durability/constants.ts
|
|
@@ -103,7 +103,10 @@ function encodeSegmentManifest(manifest) {
|
|
|
103
103
|
checkpoint: manifest.checkpoint.map((c) => ({
|
|
104
104
|
partitionId: c.partitionId,
|
|
105
105
|
lastSeqNo: c.lastSeqNo,
|
|
106
|
-
primaryTerm: c.primaryTerm
|
|
106
|
+
primaryTerm: c.primaryTerm,
|
|
107
|
+
...c.termHistory === void 0 ? {} : {
|
|
108
|
+
termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
|
|
109
|
+
}
|
|
107
110
|
})),
|
|
108
111
|
partitions: manifest.partitions.map((p) => ({
|
|
109
112
|
partitionId: p.partitionId,
|
|
@@ -253,30 +256,40 @@ function frozenSegmentsOf(partition, shared) {
|
|
|
253
256
|
if (tail !== null) segments.push(tail);
|
|
254
257
|
return segments;
|
|
255
258
|
}
|
|
256
|
-
function partitionContentsOf(manager, partitionId) {
|
|
259
|
+
function partitionContentsOf(manager, partitionId, captureRecords) {
|
|
257
260
|
const partition = manager.getPartition(partitionId);
|
|
258
|
-
const
|
|
259
|
-
|
|
261
|
+
const segments = frozenSegmentsOf(partition, false);
|
|
262
|
+
const selections = segments.map((segment) => selectionOfMask(segment, keepMaskOf(segment)));
|
|
263
|
+
const contents = { partitionId, docCount: partition.count(), selections };
|
|
264
|
+
if (captureRecords !== void 0) contents.writeRecords = captureRecords(segments);
|
|
265
|
+
return contents;
|
|
260
266
|
}
|
|
261
|
-
function captureWholePartition(manager, partitionId) {
|
|
267
|
+
function captureWholePartition(manager, partitionId, captureRecords) {
|
|
262
268
|
if (typeof SharedArrayBuffer !== "function") return null;
|
|
263
269
|
const partition = manager.getPartition(partitionId);
|
|
264
270
|
if (!isCompositePartition(partition) || partition.frozenSegmentCount() === 0) return null;
|
|
271
|
+
const frozen = frozenSegmentsOf(partition, true);
|
|
272
|
+
const records = captureRecords?.(frozen);
|
|
265
273
|
const segments = [];
|
|
266
|
-
for (const segment of
|
|
274
|
+
for (const segment of frozen) {
|
|
267
275
|
if (segment.sharedSnapshot === null) return null;
|
|
268
|
-
|
|
276
|
+
const captured = { snapshot: segment.sharedSnapshot, keep: keepMaskOf(segment) };
|
|
277
|
+
const held = records?.get(segment);
|
|
278
|
+
if (held !== void 0) captured.writeRecords = held;
|
|
279
|
+
segments.push(captured);
|
|
269
280
|
}
|
|
270
281
|
return { partitionId, docCount: partition.count(), segments };
|
|
271
282
|
}
|
|
272
283
|
function contentsOfCaptured(captured) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
};
|
|
284
|
+
const writeRecords = /* @__PURE__ */ new Map();
|
|
285
|
+
const selections = captured.segments.map(({ snapshot, keep, writeRecords: held }) => {
|
|
286
|
+
const segment = createSharedFrozenSegment(snapshot);
|
|
287
|
+
if (held !== void 0) writeRecords.set(segment, held);
|
|
288
|
+
return selectionOfMask(segment, keep);
|
|
289
|
+
});
|
|
290
|
+
const contents = { partitionId: captured.partitionId, docCount: captured.docCount, selections };
|
|
291
|
+
if (writeRecords.size > 0) contents.writeRecords = writeRecords;
|
|
292
|
+
return contents;
|
|
280
293
|
}
|
|
281
294
|
|
|
282
295
|
// src/persistence/durability/partition-checkpoint.ts
|
|
@@ -358,8 +371,10 @@ function nextMarkerSlot(lastWrittenSlot) {
|
|
|
358
371
|
function markerSlotOffset(slotIndex) {
|
|
359
372
|
return slotIndex * COMMIT_MARKER_SLOT_SIZE;
|
|
360
373
|
}
|
|
361
|
-
function createEntryMessage(entry, sourceId, indexUuid) {
|
|
362
|
-
const payload =
|
|
374
|
+
function createEntryMessage(entry, sourceId, indexUuid, previousPrimaryTerm) {
|
|
375
|
+
const payload = { entry };
|
|
376
|
+
if (indexUuid !== void 0) payload.indexUuid = indexUuid;
|
|
377
|
+
if (previousPrimaryTerm !== void 0) payload.previousPrimaryTerm = previousPrimaryTerm;
|
|
363
378
|
return {
|
|
364
379
|
type: ReplicationMessageTypes.ENTRY,
|
|
365
380
|
sourceId,
|
|
@@ -367,8 +382,10 @@ function createEntryMessage(entry, sourceId, indexUuid) {
|
|
|
367
382
|
payload: encode(payload)
|
|
368
383
|
};
|
|
369
384
|
}
|
|
370
|
-
function createEntryBatchMessage(entries, sourceId, indexUuid) {
|
|
371
|
-
const payload =
|
|
385
|
+
function createEntryBatchMessage(entries, sourceId, indexUuid, previousPrimaryTerm) {
|
|
386
|
+
const payload = { entries };
|
|
387
|
+
if (indexUuid !== void 0) payload.indexUuid = indexUuid;
|
|
388
|
+
if (previousPrimaryTerm !== void 0) payload.previousPrimaryTerm = previousPrimaryTerm;
|
|
372
389
|
return {
|
|
373
390
|
type: ReplicationMessageTypes.ENTRY_BATCH,
|
|
374
391
|
sourceId,
|
|
@@ -454,6 +471,15 @@ function optionalIndexUuid(value, payloadName) {
|
|
|
454
471
|
}
|
|
455
472
|
return value;
|
|
456
473
|
}
|
|
474
|
+
function optionalPreviousPrimaryTerm(value, payloadName) {
|
|
475
|
+
if (value === void 0 || value === null) {
|
|
476
|
+
return void 0;
|
|
477
|
+
}
|
|
478
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
|
|
479
|
+
throw new Error(`Invalid ${payloadName}: "previousPrimaryTerm" must be a non-negative integer or absent`);
|
|
480
|
+
}
|
|
481
|
+
return value;
|
|
482
|
+
}
|
|
457
483
|
function isPlainObject(value) {
|
|
458
484
|
if (!isRecord(value)) {
|
|
459
485
|
return false;
|
|
@@ -491,6 +517,7 @@ function validateEntryPayload(decoded) {
|
|
|
491
517
|
throw new Error('Invalid EntryPayload: "entry.checksum" must be a number');
|
|
492
518
|
}
|
|
493
519
|
optionalIndexUuid(decoded.indexUuid, "EntryPayload");
|
|
520
|
+
optionalPreviousPrimaryTerm(decoded.previousPrimaryTerm, "EntryPayload");
|
|
494
521
|
return decoded;
|
|
495
522
|
}
|
|
496
523
|
function validateEntryBatchPayload(decoded) {
|
|
@@ -514,8 +541,12 @@ function validateEntryBatchPayload(decoded) {
|
|
|
514
541
|
throw new Error("Invalid EntryBatchPayload: entries must carry contiguous ascending sequence numbers");
|
|
515
542
|
}
|
|
516
543
|
}
|
|
544
|
+
const payload = { entries: validated };
|
|
517
545
|
const indexUuid = optionalIndexUuid(decoded.indexUuid, "EntryBatchPayload");
|
|
518
|
-
|
|
546
|
+
if (indexUuid !== void 0) payload.indexUuid = indexUuid;
|
|
547
|
+
const previousPrimaryTerm = optionalPreviousPrimaryTerm(decoded.previousPrimaryTerm, "EntryBatchPayload");
|
|
548
|
+
if (previousPrimaryTerm !== void 0) payload.previousPrimaryTerm = previousPrimaryTerm;
|
|
549
|
+
return payload;
|
|
519
550
|
}
|
|
520
551
|
function validateForwardBatchPayload(decoded) {
|
|
521
552
|
if (!isRecord(decoded)) {
|
|
@@ -905,6 +936,17 @@ async function* walEntriesInRange(directory, indexName, partitionId, fromSeqNoEx
|
|
|
905
936
|
throw durableRecordMissing(indexName, partitionId, highestRead, wal.marker);
|
|
906
937
|
}
|
|
907
938
|
}
|
|
939
|
+
function writeRecordsOf(documents, written) {
|
|
940
|
+
const seqNos = new Float64Array(documents.length);
|
|
941
|
+
const primaryTerms = new Float64Array(documents.length);
|
|
942
|
+
for (let at = 0; at < documents.length; at++) {
|
|
943
|
+
const entry = written.get(documents[at].docId);
|
|
944
|
+
if (entry === void 0) continue;
|
|
945
|
+
seqNos[at] = entry.seqNo;
|
|
946
|
+
primaryTerms[at] = entry.primaryTerm;
|
|
947
|
+
}
|
|
948
|
+
return { seqNos, primaryTerms };
|
|
949
|
+
}
|
|
908
950
|
function everyVectorFieldIsTopLevel(vectorFieldPaths) {
|
|
909
951
|
for (const fieldPath of vectorFieldPaths) {
|
|
910
952
|
if (fieldPath.includes(".")) return false;
|
|
@@ -922,15 +964,18 @@ async function buildSegmentFromEntries(input) {
|
|
|
922
964
|
const leavesVectorsUndecoded = everyVectorFieldIsTopLevel(input.vectorFieldPaths);
|
|
923
965
|
const live = /* @__PURE__ */ new Map();
|
|
924
966
|
const deleted = /* @__PURE__ */ new Set();
|
|
967
|
+
const written = /* @__PURE__ */ new Map();
|
|
925
968
|
for await (const entry of input.entries) {
|
|
926
969
|
if (entry.operation === "DELETE") {
|
|
927
970
|
deleted.add(entry.documentId);
|
|
928
971
|
live.delete(entry.documentId);
|
|
972
|
+
written.delete(entry.documentId);
|
|
929
973
|
continue;
|
|
930
974
|
}
|
|
931
975
|
if (entry.document === null) continue;
|
|
932
976
|
live.delete(entry.documentId);
|
|
933
977
|
live.set(entry.documentId, documentWithoutVectors(entry.document, input.vectorFieldPaths, leavesVectorsUndecoded));
|
|
978
|
+
if (input.keepsWriteRecords) written.set(entry.documentId, entry);
|
|
934
979
|
}
|
|
935
980
|
const tombstones = [];
|
|
936
981
|
for (const docId of deleted) {
|
|
@@ -953,7 +998,9 @@ async function buildSegmentFromEntries(input) {
|
|
|
953
998
|
payload,
|
|
954
999
|
documents.map((entry) => entry.document)
|
|
955
1000
|
);
|
|
956
|
-
|
|
1001
|
+
const built = { selections: [{ segment }], tombstones, docCount: live.size };
|
|
1002
|
+
if (input.keepsWriteRecords) built.writeRecords = /* @__PURE__ */ new Map([[segment, writeRecordsOf(documents, written)]]);
|
|
1003
|
+
return built;
|
|
957
1004
|
}
|
|
958
1005
|
var FIXMAP = 128;
|
|
959
1006
|
var MAP16 = 222;
|
|
@@ -1156,7 +1203,8 @@ function encodeKeywordSegment(contents) {
|
|
|
1156
1203
|
const { arrays } = contents;
|
|
1157
1204
|
const postings = postingsInTokenOrder(arrays);
|
|
1158
1205
|
const out = new MessagePackChunks();
|
|
1159
|
-
|
|
1206
|
+
const { writeRecords } = contents;
|
|
1207
|
+
out.map(writeRecords === void 0 ? TOP_LEVEL_ENTRIES : TOP_LEVEL_ENTRIES + 2);
|
|
1160
1208
|
out.key("v").value(KEYWORD_SEGMENT_PAYLOAD_VERSION);
|
|
1161
1209
|
out.key("schema").value(contents.schema);
|
|
1162
1210
|
out.key("tombstones").value(contents.tombstones);
|
|
@@ -1194,6 +1242,10 @@ function encodeKeywordSegment(contents) {
|
|
|
1194
1242
|
writeSurfaceForms(out, arrays);
|
|
1195
1243
|
out.key("partialWords");
|
|
1196
1244
|
writePartialWords(out, arrays);
|
|
1245
|
+
if (writeRecords !== void 0) {
|
|
1246
|
+
out.key("seqNos").binary(uint64Bytes(writeRecords.seqNos));
|
|
1247
|
+
out.key("primaryTerms").binary(uint64Bytes(writeRecords.primaryTerms));
|
|
1248
|
+
}
|
|
1197
1249
|
return out;
|
|
1198
1250
|
}
|
|
1199
1251
|
|
|
@@ -1405,6 +1457,28 @@ function noSpellingsOf(analysis) {
|
|
|
1405
1457
|
if (analysis === null || analysis.fields.length === 0) return null;
|
|
1406
1458
|
return { fields: [...analysis.fields], tokens: [], spellings: [], counts: [] };
|
|
1407
1459
|
}
|
|
1460
|
+
function writeRecordsOfGroup(group, records, count) {
|
|
1461
|
+
const seqNos = new Float64Array(count);
|
|
1462
|
+
const primaryTerms = new Float64Array(count);
|
|
1463
|
+
let at = 0;
|
|
1464
|
+
for (const selection of group?.selections ?? []) {
|
|
1465
|
+
const source = records.get(selection.segment);
|
|
1466
|
+
for (let ordinal = 0; ordinal < selection.segment.arrays.documentCount; ordinal++) {
|
|
1467
|
+
if (!selectionKeeps(selection, ordinal)) continue;
|
|
1468
|
+
if (source !== void 0) {
|
|
1469
|
+
seqNos[at] = source.seqNos[ordinal];
|
|
1470
|
+
primaryTerms[at] = source.primaryTerms[ordinal];
|
|
1471
|
+
}
|
|
1472
|
+
at += 1;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return { seqNos, primaryTerms };
|
|
1476
|
+
}
|
|
1477
|
+
function withWriteRecords(contents, group, request) {
|
|
1478
|
+
if (request.writeRecords === void 0) return contents;
|
|
1479
|
+
const writeRecords = writeRecordsOfGroup(group, request.writeRecords, contents.arrays.documentCount);
|
|
1480
|
+
return { ...contents, writeRecords };
|
|
1481
|
+
}
|
|
1408
1482
|
function contentsOfGroup(group, request, tombstones) {
|
|
1409
1483
|
const { schema, partialWordAnalysis, textAnalysis } = request;
|
|
1410
1484
|
if (group === null) {
|
|
@@ -1433,7 +1507,7 @@ function requireRoomForAnotherSegment(state) {
|
|
|
1433
1507
|
async function writeGroup(state, group) {
|
|
1434
1508
|
const { request } = state;
|
|
1435
1509
|
const tombstones = state.tombstonesWritten ? [] : [...request.tombstones];
|
|
1436
|
-
const contents = contentsOfGroup(group, request, tombstones);
|
|
1510
|
+
const contents = withWriteRecords(contentsOfGroup(group, request, tombstones), group, request);
|
|
1437
1511
|
const encoded = encodeKeywordSegment(contents);
|
|
1438
1512
|
if (HEADER_SIZE + encoded.byteLength > MAX_FILE_BYTES && group !== null && group.documentCount > 1) {
|
|
1439
1513
|
const [first, second] = halvesOf(group);
|
|
@@ -1520,6 +1594,15 @@ function applyTimeOrder(frozen, contents) {
|
|
|
1520
1594
|
}
|
|
1521
1595
|
}
|
|
1522
1596
|
}
|
|
1597
|
+
function writeRecordsOf2(frozen, contents) {
|
|
1598
|
+
if (contents.every((segment) => segment.writeRecords === void 0)) return void 0;
|
|
1599
|
+
const records = /* @__PURE__ */ new Map();
|
|
1600
|
+
for (let at = 0; at < frozen.length; at++) {
|
|
1601
|
+
const held = contents[at].writeRecords;
|
|
1602
|
+
if (held !== void 0) records.set(frozen[at], held);
|
|
1603
|
+
}
|
|
1604
|
+
return records;
|
|
1605
|
+
}
|
|
1523
1606
|
function retainedTombstones(frozen, contents) {
|
|
1524
1607
|
const retained = /* @__PURE__ */ new Set();
|
|
1525
1608
|
for (const segment of contents) {
|
|
@@ -1543,6 +1626,7 @@ async function compactPartitionSegments(input) {
|
|
|
1543
1626
|
for (const ref of windowRefs) contents.push(await readSegmentFile(input.store, ref));
|
|
1544
1627
|
const frozen = contents.map(frozenOf);
|
|
1545
1628
|
applyTimeOrder(frozen, contents);
|
|
1629
|
+
const writeRecords = writeRecordsOf2(frozen, contents);
|
|
1546
1630
|
const written = await writeSegmentsOf({
|
|
1547
1631
|
store: input.store,
|
|
1548
1632
|
indexName: input.indexName,
|
|
@@ -1553,7 +1637,8 @@ async function compactPartitionSegments(input) {
|
|
|
1553
1637
|
textAnalysis: input.textAnalysis,
|
|
1554
1638
|
selections: frozen.map((segment) => ({ segment })),
|
|
1555
1639
|
tombstones: retainedTombstones(frozen, contents),
|
|
1556
|
-
mergesIntoOneFile: true
|
|
1640
|
+
mergesIntoOneFile: true,
|
|
1641
|
+
...writeRecords === void 0 ? {} : { writeRecords }
|
|
1557
1642
|
});
|
|
1558
1643
|
return {
|
|
1559
1644
|
segments: [
|
|
@@ -1619,7 +1704,8 @@ async function writeWholePartition(context, partitionId, priorPartition, whole)
|
|
|
1619
1704
|
partialWordAnalysis: context.partialWordAnalysis,
|
|
1620
1705
|
textAnalysis: context.textAnalysis,
|
|
1621
1706
|
selections: whole.selections,
|
|
1622
|
-
tombstones: []
|
|
1707
|
+
tombstones: [],
|
|
1708
|
+
...whole.writeRecords === void 0 ? {} : { writeRecords: whole.writeRecords }
|
|
1623
1709
|
});
|
|
1624
1710
|
return { partitionId, nextSegmentId: written.nextSegmentId, segments: written.segments };
|
|
1625
1711
|
}
|
|
@@ -1629,7 +1715,8 @@ async function writeLoggedChanges(context, partitionId, priorPartition, entries)
|
|
|
1629
1715
|
config: context.config,
|
|
1630
1716
|
language: getLanguage(context.config.language ?? "english"),
|
|
1631
1717
|
vectorFieldPaths: context.vectorFieldPaths,
|
|
1632
|
-
entries
|
|
1718
|
+
entries,
|
|
1719
|
+
keepsWriteRecords: context.input.keepsWriteRecords === true
|
|
1633
1720
|
});
|
|
1634
1721
|
let segments = priorPartition ? [...priorPartition.segments] : [];
|
|
1635
1722
|
let nextSegmentId = priorPartition?.nextSegmentId ?? 0;
|
|
@@ -1643,7 +1730,8 @@ async function writeLoggedChanges(context, partitionId, priorPartition, entries)
|
|
|
1643
1730
|
partialWordAnalysis: context.partialWordAnalysis,
|
|
1644
1731
|
textAnalysis: context.textAnalysis,
|
|
1645
1732
|
selections: built.selections,
|
|
1646
|
-
tombstones: built.tombstones
|
|
1733
|
+
tombstones: built.tombstones,
|
|
1734
|
+
...built.writeRecords === void 0 ? {} : { writeRecords: built.writeRecords }
|
|
1647
1735
|
});
|
|
1648
1736
|
segments.push(...written.segments);
|
|
1649
1737
|
nextSegmentId = written.nextSegmentId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MIN_HYBRID_DEPTH, MAX_HYBRID_DEPTH } from './chunk-E74YLAIG.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/search/hybrid-depth.ts
|
|
5
5
|
function fixedHybridDepthOf(hybrid) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-
|
|
2
|
-
import { getNestedValue } from './chunk-
|
|
3
|
-
import { requireValidFieldTypes } from './chunk-
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-3RRATITJ.mjs';
|
|
2
|
+
import { getNestedValue } from './chunk-KCQG2PJT.mjs';
|
|
3
|
+
import { requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
|
|
4
4
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
5
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
5
|
+
import { ErrorCodes, NarsilError } from './chunk-OBWUWZRA.mjs';
|
|
6
6
|
import { decode } from '@msgpack/msgpack';
|
|
7
7
|
|
|
8
8
|
function validateReplicationEntry(entry, localPrimaryTerm, log) {
|
|
@@ -477,6 +477,42 @@ function decodePartialWords(raw, tokenCount, context) {
|
|
|
477
477
|
return { fields, spellings, spellingOffsets, spellingTokens, spellingCounts, runs, runOffsets, runEntries };
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
+
// src/serialization/keyword-segment/write-records.ts
|
|
481
|
+
var UINT64_BYTES = 8;
|
|
482
|
+
function uint64Bytes(values) {
|
|
483
|
+
const bytes = new Uint8Array(values.length * UINT64_BYTES);
|
|
484
|
+
const view = new DataView(bytes.buffer);
|
|
485
|
+
for (let at = 0; at < values.length; at++) view.setBigUint64(at * UINT64_BYTES, BigInt(values[at]), true);
|
|
486
|
+
return bytes;
|
|
487
|
+
}
|
|
488
|
+
function uint64sOf(bytes, name) {
|
|
489
|
+
const values = new Float64Array(bytes.byteLength / UINT64_BYTES);
|
|
490
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
491
|
+
for (let at = 0; at < values.length; at++) {
|
|
492
|
+
const value = view.getBigUint64(at * UINT64_BYTES, true);
|
|
493
|
+
if (value > BigInt(Number.MAX_SAFE_INTEGER)) corrupt(`${name} holds a value above 2^53 - 1`, { at });
|
|
494
|
+
values[at] = Number(value);
|
|
495
|
+
}
|
|
496
|
+
return values;
|
|
497
|
+
}
|
|
498
|
+
function decodeWriteRecords(raw, documentCount) {
|
|
499
|
+
const rawSeqNos = requireBytesOrNil(raw.seqNos, "seqNos", UINT64_BYTES);
|
|
500
|
+
const rawTerms = requireBytesOrNil(raw.primaryTerms, "primaryTerms", UINT64_BYTES);
|
|
501
|
+
if (rawSeqNos === null !== (rawTerms === null))
|
|
502
|
+
corrupt("seqNos and primaryTerms must both be present or both absent");
|
|
503
|
+
if (rawSeqNos === null || rawTerms === null) return null;
|
|
504
|
+
const seqNos = uint64sOf(rawSeqNos, "seqNos");
|
|
505
|
+
const primaryTerms = uint64sOf(rawTerms, "primaryTerms");
|
|
506
|
+
requireCount(seqNos.length, documentCount, "seqNos");
|
|
507
|
+
requireCount(primaryTerms.length, documentCount, "primaryTerms");
|
|
508
|
+
for (let at = 0; at < documentCount; at++) {
|
|
509
|
+
if (seqNos[at] === 0 && primaryTerms[at] !== 0) {
|
|
510
|
+
corrupt(`primaryTerms gives document ${at} a term without a seqNo`, { at });
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return { seqNos, primaryTerms };
|
|
514
|
+
}
|
|
515
|
+
|
|
480
516
|
// src/serialization/keyword-segment/decode.ts
|
|
481
517
|
function decodeSchema(raw) {
|
|
482
518
|
const schema = requireRecord(raw, "schema");
|
|
@@ -608,7 +644,8 @@ function decodeKeywordSegment(payload, shared) {
|
|
|
608
644
|
surfaceTable: decodeSurfaceForms(raw.surfaceForms, context),
|
|
609
645
|
partialWords: decodePartialWords(raw.partialWords, postings.tokenTable.offsets.length - 1, context)
|
|
610
646
|
};
|
|
611
|
-
|
|
647
|
+
const writeRecords = decodeWriteRecords(raw, documentCount);
|
|
648
|
+
return writeRecords === null ? { schema, tombstones, arrays } : { schema, tombstones, arrays, writeRecords };
|
|
612
649
|
}
|
|
613
650
|
|
|
614
|
-
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeKeywordSegment, littleEndianBytes, restoreVectorFields, setNestedValue, validateReplicationEntry };
|
|
651
|
+
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeKeywordSegment, littleEndianBytes, restoreVectorFields, setNestedValue, uint64Bytes, validateReplicationEntry };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, queryBindingOf, executeQuery, executePreflight, executeSuggest, executeListDocuments, validateDocId } from './chunk-
|
|
2
|
-
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-
|
|
3
|
-
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-
|
|
1
|
+
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, queryBindingOf, executeQuery, executePreflight, executeSuggest, executeListDocuments, validateDocId } from './chunk-GLZI636G.mjs';
|
|
2
|
+
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-N57XXGPG.mjs';
|
|
3
|
+
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-6PN3U6XW.mjs';
|
|
4
4
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
5
|
-
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-
|
|
6
|
-
import { requirePatternSearchFor, requirePartialWordSearchFor, collectQueryTermStats, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-
|
|
7
|
-
import { generateId, getLanguage } from './chunk-
|
|
5
|
+
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-V7ISFBFC.mjs';
|
|
6
|
+
import { requirePatternSearchFor, requirePartialWordSearchFor, collectQueryTermStats, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-5WEBVYOA.mjs';
|
|
7
|
+
import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
|
|
8
8
|
import { readHeapStatistics } from './chunk-SOADQINJ.mjs';
|
|
9
9
|
import { DEFAULT_MAX_RERANK_WINDOW, DEFAULT_RERANK_TIMEOUT_MS } from './chunk-HJSN7UYG.mjs';
|
|
10
10
|
import { MAX_INDEX_CONFIGURATION_BYTES, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MAX_IMPORT_REFUSALS_REPORTED, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION, BATCH_CHUNK_SIZE } from './chunk-LXWDQLTW.mjs';
|
|
11
|
-
import { requireSearchBackendSettings } from './chunk-
|
|
12
|
-
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-
|
|
13
|
-
import { getNestedValue } from './chunk-
|
|
14
|
-
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, extractVectorFieldsFromSchema, schemaFieldsOf, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-
|
|
11
|
+
import { requireSearchBackendSettings } from './chunk-VK45J47R.mjs';
|
|
12
|
+
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-HNAP2KTG.mjs';
|
|
13
|
+
import { getNestedValue } from './chunk-KCQG2PJT.mjs';
|
|
14
|
+
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, extractVectorFieldsFromSchema, schemaFieldsOf, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-DG62H7OD.mjs';
|
|
15
15
|
import { NATIVE_CRC32_MIN_BYTES, MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-U476IXKQ.mjs';
|
|
16
|
-
import { isSingleStringFieldType } from './chunk-
|
|
16
|
+
import { isSingleStringFieldType } from './chunk-6ODIY6ZB.mjs';
|
|
17
17
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
18
18
|
import { createRequestId, isValidWorkerResponse } from './chunk-CQUMNIIG.mjs';
|
|
19
|
-
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-
|
|
19
|
+
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-QI6JW4PM.mjs';
|
|
20
20
|
import { noteThreadSlotLive, threadSlotOfWorker, noteThreadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
21
21
|
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
22
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
22
|
+
import { ErrorCodes, NarsilError } from './chunk-OBWUWZRA.mjs';
|
|
23
23
|
import { encode, decode } from '@msgpack/msgpack';
|
|
24
24
|
import * as zlib from 'zlib';
|
|
25
25
|
|
|
@@ -4026,7 +4026,7 @@ async function emitWriteEventAfter(source, indexName, write) {
|
|
|
4026
4026
|
// src/engine/core.ts
|
|
4027
4027
|
async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
4028
4028
|
validateWorkerConfig(config?.workers, config?.lifecycle);
|
|
4029
|
-
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-
|
|
4029
|
+
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-C2435MPK.mjs')).resolveRerankSettings(config);
|
|
4030
4030
|
const eventHandlers = eventHandlersOf(config?.events);
|
|
4031
4031
|
const vectorWorkerCount = splitWorkerBudget(resolveWorkerCount(config?.workers?.count)).vector;
|
|
4032
4032
|
const vectorCopyPolicy = {
|
|
@@ -4037,7 +4037,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4037
4037
|
if (config?.lifecycle !== void 0 && durabilityTier === null) {
|
|
4038
4038
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index lifecycle settings require durability");
|
|
4039
4039
|
}
|
|
4040
|
-
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-
|
|
4040
|
+
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-EQTFL3B4.mjs');
|
|
4041
4041
|
const filesystemDurability = durabilityTier?.kind === "wal";
|
|
4042
4042
|
const executor = createDirectExecutor({
|
|
4043
4043
|
vectorWorkerCopies: vectorCopyPolicy,
|
|
@@ -4334,7 +4334,7 @@ async function shutdownEngine(core) {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
4336
4336
|
if (core.rerankAdapters.size > 0) {
|
|
4337
|
-
await (await import('./runtime-
|
|
4337
|
+
await (await import('./runtime-C2435MPK.mjs')).shutdownRerankAdapters(core.rerankAdapters);
|
|
4338
4338
|
}
|
|
4339
4339
|
await orchestrator.shutdown();
|
|
4340
4340
|
await executor.shutdown();
|
|
@@ -6951,14 +6951,14 @@ function portabilityOperations(core, config, engine) {
|
|
|
6951
6951
|
return {
|
|
6952
6952
|
snapshot(indexName) {
|
|
6953
6953
|
return withOpenIndex(indexName, async () => {
|
|
6954
|
-
const { createSnapshot } = await import('./snapshot-
|
|
6954
|
+
const { createSnapshot } = await import('./snapshot-EU6NNB2P.mjs');
|
|
6955
6955
|
return createSnapshot(snapshotDepsOf(indexName));
|
|
6956
6956
|
});
|
|
6957
6957
|
},
|
|
6958
6958
|
async restore(indexName, data) {
|
|
6959
6959
|
core.guardShutdown();
|
|
6960
6960
|
validateIndexName(indexName);
|
|
6961
|
-
const restored = import('./restore-queue-
|
|
6961
|
+
const restored = import('./restore-queue-WZTMTJP2.mjs').then(
|
|
6962
6962
|
({ queueRestore }) => queueRestore(core, restoreHost, restoresInFlight, indexName, data)
|
|
6963
6963
|
);
|
|
6964
6964
|
await emitWriteEventAfter(core, indexName, restored);
|
|
@@ -6967,8 +6967,8 @@ function portabilityOperations(core, config, engine) {
|
|
|
6967
6967
|
exportDocuments(indexName) {
|
|
6968
6968
|
return withOpenIndex(indexName, async () => {
|
|
6969
6969
|
const [{ checkpointForArchive }, { documentExportStream }] = await Promise.all([
|
|
6970
|
-
import('./snapshot-
|
|
6971
|
-
import('./write-
|
|
6970
|
+
import('./snapshot-EU6NNB2P.mjs'),
|
|
6971
|
+
import('./write-CKRWS3P5.mjs')
|
|
6972
6972
|
]);
|
|
6973
6973
|
const header = indexConfigurationOf(core.requireIndex(indexName));
|
|
6974
6974
|
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
@@ -7020,7 +7020,7 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
7020
7020
|
const manager = core.requireManager(indexName);
|
|
7021
7021
|
const scoped = scopedParams(params, options);
|
|
7022
7022
|
await core.pluginRegistry.runHook("beforeSearch", { indexName, params: scoped });
|
|
7023
|
-
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-
|
|
7023
|
+
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-C2435MPK.mjs');
|
|
7024
7024
|
const resolvedParams = await resolveVectorText(
|
|
7025
7025
|
rerank === void 0 ? scoped : rerank.withRerankQueryText(scoped),
|
|
7026
7026
|
entry.embeddingAdapter,
|