@delali/narsil 0.3.1-next.90 → 0.3.1-next.94
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-3GZQKGVQ.mjs → chunk-4JTBL63P.mjs} +13 -5
- package/dist/browser/{chunk-3ZRMZIH4.mjs → chunk-5S74HQRT.mjs} +208 -78
- package/dist/browser/{chunk-FHFFWLEK.mjs → chunk-HARBSUWP.mjs} +3 -4
- package/dist/browser/{chunk-RAHUQOJL.mjs → chunk-HC6DMR4T.mjs} +2445 -2107
- package/dist/browser/{chunk-JACCR3BJ.mjs → chunk-PP6N5CCS.mjs} +2 -2
- package/dist/browser/{chunk-NQW2YXEX.mjs → chunk-WKPJ4E73.mjs} +1 -1
- package/dist/browser/{durability-wiring-VSUBLUDK.mjs → durability-wiring-7DKYHKT5.mjs} +498 -71
- package/dist/browser/{module-E25UDADM.mjs → module-O5WH32EL.mjs} +102 -54
- package/dist/browser/release-76MXRPGV.mjs +33 -0
- package/dist/browser/replace-RURXTGVG.mjs +57 -0
- package/dist/browser/restore-queue-Z7FZZNKH.mjs +35 -0
- package/dist/browser/{snapshot-5MXBEDXF.mjs → snapshot-PPTZ565G.mjs} +368 -103
- package/dist/browser/{write-6SBYTS62.mjs → write-2ZAA7UDH.mjs} +4 -4
- package/dist/{capabilities-SJPttcgQ.d.ts → capabilities-xsJfdFoQ.d.ts} +11 -3
- package/dist/chunk-2GZGBOQI.mjs +426 -0
- package/dist/{chunk-CVQWQVFX.mjs → chunk-4ZJWRETC.mjs} +2 -2
- package/dist/chunk-7KC56574.mjs +507 -0
- package/dist/{chunk-MXS5HWIH.mjs → chunk-7VALMHZF.mjs} +89 -17
- package/dist/chunk-7X5JST5L.mjs +114 -0
- package/dist/{chunk-UKSUENHK.mjs → chunk-AF2CIKYC.mjs} +40 -26
- package/dist/{chunk-BVOJIYRV.mjs → chunk-BB7MASRQ.mjs} +1 -1
- package/dist/{chunk-R6BMMQXH.mjs → chunk-C45FUYPI.mjs} +193 -79
- package/dist/{chunk-EMXAYPTQ.mjs → chunk-CHOGQSHK.mjs} +2326 -3503
- package/dist/{chunk-QZN3MIJ3.mjs → chunk-ES33L3HO.mjs} +2 -2
- package/dist/{chunk-VY4DXZ5P.mjs → chunk-EWBXO45L.mjs} +3 -3
- package/dist/{chunk-QAMUC2BJ.mjs → chunk-EX62BQT6.mjs} +10 -9
- package/dist/{chunk-MWJIAREY.mjs → chunk-EZD4MWOU.mjs} +4 -4
- package/dist/{chunk-YCJLVNWR.mjs → chunk-F52QGNZ2.mjs} +1 -1
- package/dist/{chunk-URGLSNKR.mjs → chunk-GJZHU4FC.mjs} +202 -16
- package/dist/{chunk-S4LQDSUL.mjs → chunk-J53IHLG7.mjs} +7 -7
- package/dist/{chunk-R7OSDAFK.mjs → chunk-K6A4FCVR.mjs} +1 -1
- package/dist/chunk-KOKM4PQN.mjs +52 -0
- package/dist/{chunk-GCM3JFVA.mjs → chunk-OHP7QR33.mjs} +2 -1
- package/dist/{chunk-T6CNO72J.mjs → chunk-QM3VPX4Z.mjs} +2 -2
- package/dist/{chunk-V7YUSKKZ.mjs → chunk-QWWCLRXX.mjs} +10 -6
- package/dist/chunk-QY7GC2MW.mjs +33 -0
- package/dist/{chunk-DCK4P5BI.mjs → chunk-R36MIGBU.mjs} +100 -59
- package/dist/{chunk-YRX6XMOQ.mjs → chunk-R6PR4WYZ.mjs} +1 -0
- package/dist/{chunk-RVM7AODE.mjs → chunk-RDJKYKMQ.mjs} +2 -2
- package/dist/{chunk-OOSIDHA3.mjs → chunk-RSRVGAIQ.mjs} +1 -1
- package/dist/{chunk-XSZVS4S3.mjs → chunk-RUIXODYU.mjs} +9 -4
- package/dist/{chunk-A3UB2MXL.mjs → chunk-SBCEHIPL.mjs} +4 -507
- package/dist/{chunk-TPJU7NDJ.mjs → chunk-SYWGORQB.mjs} +1 -0
- package/dist/chunk-UAUZGXJP.mjs +3591 -0
- package/dist/{chunk-CL4OM7GB.mjs → chunk-WBS3EYC4.mjs} +12 -8
- package/dist/{chunk-J2BPXTD7.mjs → chunk-WLOF6HSP.mjs} +3 -3
- package/dist/chunk-X5CV2E2B.mjs +1 -0
- package/dist/{chunk-ULRPNYAG.mjs → chunk-Z3MOCHG5.mjs} +120 -62
- package/dist/chunk-ZHS44YKF.mjs +35 -0
- package/dist/{client-BMK53IR2.d.ts → client-CgayPw2R.d.ts} +27 -3
- package/dist/client.d.ts +9 -8
- package/dist/client.mjs +16 -2
- package/dist/{config-UJx1dyX1.d.ts → config-3kBsQ0Pi.d.ts} +2 -2
- package/dist/{config-BUR-7eVQ.d.ts → config-B-RnO6dr.d.ts} +2 -2
- package/dist/direct-executor-IJTRU3YN.mjs +22 -0
- package/dist/distribution/coordinator/etcd.d.ts +3 -2
- package/dist/distribution/coordinator/etcd.mjs +5 -1
- package/dist/distribution/coordinator/in-memory.d.ts +3 -2
- package/dist/distribution/coordinator/in-memory.mjs +4 -0
- package/dist/distribution/transport/grpc.mjs +3 -3
- package/dist/distribution/transport/in-memory.mjs +1 -1
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +43 -9
- package/dist/distribution.mjs +4620 -4293
- package/dist/{durability-wiring-ZLRQU6FG.mjs → durability-wiring-Y55SCPFC.mjs} +524 -93
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-9X6W5naj.d.ts → engine-DSUfY2F0.d.ts} +53 -17
- package/dist/{index-vCMu8OeQ.d.ts → index-ONAEaqtx.d.ts} +8 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.ts +44 -25
- package/dist/index.mjs +22 -18
- package/dist/{memory-CV9NAxLY.d.ts → memory-wuXcYOD1.d.ts} +99 -79
- package/dist/{module-WIDYIJLY.mjs → module-VITS4ZR5.mjs} +72 -38
- package/dist/partial-words.mjs +5 -4
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +60 -58
- package/dist/persistence/durability/checkpoint-worker.mjs +27 -23
- package/dist/react.d.ts +8 -7
- package/dist/react.mjs +1 -0
- package/dist/release-BH3DKW3T.mjs +33 -0
- package/dist/replace-CEO5KJJ3.mjs +57 -0
- package/dist/restore-queue-4SG45BLF.mjs +35 -0
- package/dist/{schema-DtsgmNfU.d.ts → schema-DttzM-ln.d.ts} +12 -0
- package/dist/server.d.ts +11 -10
- package/dist/server.mjs +38 -11
- package/dist/snapshot-XBKE7PUG.mjs +738 -0
- package/dist/synonyms-CpOAHPa-.d.ts +52 -0
- package/dist/synonyms.d.ts +22 -0
- package/dist/synonyms.mjs +12 -0
- package/dist/{tasks-BGaZJyoY.d.ts → tasks-Bj9WBlFG.d.ts} +4 -1
- package/dist/{thread-ZP3UMIZT.mjs → thread-U7XYJWGG.mjs} +17 -12
- package/dist/vector/search-worker.d.ts +2 -1
- package/dist/vector/search-worker.mjs +6 -6
- package/dist/workers/entry.mjs +6 -6
- package/dist/{write-PXDKPG2R.mjs → write-BMNV7P2H.mjs} +24 -20
- package/package.json +15 -7
- package/dist/chunk-PR4O7CAP.mjs +0 -18
- package/dist/chunk-X4SEXL4U.mjs +0 -2310
- package/dist/chunk-Y2F66IQJ.mjs +0 -74
- package/dist/chunk-ZJ4CSAB2.mjs +0 -13
- package/dist/direct-executor-EGESD26S.mjs +0 -18
- package/dist/snapshot-22CUEYYW.mjs +0 -469
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-
|
|
2
|
-
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-
|
|
3
|
-
import { VERSION, openChecksummedEnvelope, HEADER_SIZE, packChecksummedEnvelope } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { flattenSchema, requireValidFieldTypes } from './chunk-
|
|
1
|
+
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-F52QGNZ2.mjs';
|
|
2
|
+
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-EX62BQT6.mjs';
|
|
3
|
+
import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, HEADER_SIZE, packChecksummedEnvelope } from './chunk-C45FUYPI.mjs';
|
|
4
|
+
import { MAX_FILE_BYTES } from './chunk-RDJKYKMQ.mjs';
|
|
5
|
+
import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-UAUZGXJP.mjs';
|
|
6
|
+
import { flattenSchema, requireValidFieldTypes } from './chunk-4ZJWRETC.mjs';
|
|
7
7
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
9
9
|
import { decode, encode } from '@msgpack/msgpack';
|
|
10
10
|
|
|
11
11
|
// src/engine/durability-metadata.ts
|
|
@@ -62,6 +62,9 @@ function metadataFromConfig(indexName, config, partitionCount, documentCount) {
|
|
|
62
62
|
if (config.indexUuid !== void 0) {
|
|
63
63
|
metadata.indexUuid = config.indexUuid;
|
|
64
64
|
}
|
|
65
|
+
if (config.synonyms !== void 0) {
|
|
66
|
+
metadata.synonyms = config.synonyms;
|
|
67
|
+
}
|
|
65
68
|
if (config.heldPartitions !== void 0) {
|
|
66
69
|
metadata.heldPartitions = config.heldPartitions;
|
|
67
70
|
}
|
|
@@ -93,7 +96,8 @@ function metadataConfigOf(entry) {
|
|
|
93
96
|
...entry.config.strict !== void 0 ? { strict: entry.config.strict } : {},
|
|
94
97
|
...entry.config.required !== void 0 ? { required: entry.config.required } : {},
|
|
95
98
|
...entry.config.vectorPromotion !== void 0 ? { vectorPromotion: entry.config.vectorPromotion } : {},
|
|
96
|
-
...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {}
|
|
99
|
+
...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {},
|
|
100
|
+
...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {}
|
|
97
101
|
};
|
|
98
102
|
}
|
|
99
103
|
function indexMetadataOf(indexName, entry, partitionCount) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-
|
|
2
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
1
|
+
import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-4ZJWRETC.mjs';
|
|
2
|
+
import { ErrorCodes, NarsilError } from './chunk-SYWGORQB.mjs';
|
|
3
3
|
|
|
4
4
|
// src/narsil/internals.ts
|
|
5
5
|
var engineCores = /* @__PURE__ */ new WeakMap();
|
|
@@ -581,4 +581,4 @@ async function resolveVectorText(params, embeddingAdapter, signal, embeddingAdap
|
|
|
581
581
|
return { ...params, vector: resolved };
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
export { admitBufferedUpsert, admitInsert, asBatchInsertError, assertDocumentCarriesMappedVectors, bindEngineCore, collectRequiredFieldFailures, createPendingAdmissions, embedChunkDocuments, embedDocumentFields, engineCoreOf, providedDocId, readSharedConfigFields, recordPendingAdmission, requireDocumentObject, requireMatchingDocId, resolveVectorText, restoredConfigFields, restoredEmbedding, restoredPartitionConfig };
|
|
584
|
+
export { admitBufferedUpsert, admitInsert, asBatchInsertError, assertDocumentCarriesMappedVectors, bindEngineCore, collectRequiredFieldFailures, createPendingAdmissions, embedChunkDocuments, embedDocumentFields, engineCoreOf, providedDocId, readSharedConfigFields, recordPendingAdmission, rejectSnapshot, requireDocumentObject, requireMatchingDocId, resolveVectorText, restoredConfigFields, restoredEmbedding, restoredPartitionConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readTrailer, unpackLevels, stageQueryLevels, osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, writeRecord } from './chunk-37CD3OKS.mjs';
|
|
2
2
|
import { stopUsingTheNativeSearchCore, noteFallback, nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
|
|
3
|
-
import { markSimdUnavailable
|
|
4
|
-
import { OSQ_STEPS, OSQ_GRID, OSQ_QUERY_BITS,
|
|
5
|
-
import { loadNativeCore } from './chunk-
|
|
6
|
-
import { COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY,
|
|
3
|
+
import { markSimdUnavailable } from './chunk-KOKM4PQN.mjs';
|
|
4
|
+
import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_STEPS, OSQ_GRID, OSQ_QUERY_BITS, NATIVE_ATTACH_RETRY_MS, GRAPH_LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_LAMBDA, MAX_DOC_ID_TABLE_BYTES } from './chunk-QY7GC2MW.mjs';
|
|
5
|
+
import { loadNativeCore } from './chunk-ES33L3HO.mjs';
|
|
6
|
+
import { COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, DEFAULT_EF_SEARCH } from './chunk-KEHK2O6P.mjs';
|
|
7
7
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
9
9
|
|
|
10
10
|
// src/vector/shared-buffers/growable.ts
|
|
11
11
|
function sharedMemoryAvailable() {
|
|
@@ -297,6 +297,42 @@ function releaseLocksHeldBy(handles, threadSlot) {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
// src/vector/ordinal-filter.ts
|
|
301
|
+
function createOrdinalFilter(slots) {
|
|
302
|
+
return { bits: new Uint8Array(slots + 7 >>> 3), count: 0 };
|
|
303
|
+
}
|
|
304
|
+
function addToOrdinalFilter(filter, ordinal) {
|
|
305
|
+
const index = ordinal >>> 3;
|
|
306
|
+
if (index >= filter.bits.length) return;
|
|
307
|
+
const bit = 1 << (ordinal & 7);
|
|
308
|
+
if ((filter.bits[index] & bit) !== 0) return;
|
|
309
|
+
filter.bits[index] |= bit;
|
|
310
|
+
filter.count += 1;
|
|
311
|
+
}
|
|
312
|
+
function ordinalFilterHas(filter, ordinal) {
|
|
313
|
+
const index = ordinal >>> 3;
|
|
314
|
+
if (index >= filter.bits.length) return false;
|
|
315
|
+
return (filter.bits[index] & 1 << (ordinal & 7)) !== 0;
|
|
316
|
+
}
|
|
317
|
+
function removeFromOrdinalFilter(filter, ordinal) {
|
|
318
|
+
const index = ordinal >>> 3;
|
|
319
|
+
if (index >= filter.bits.length) return;
|
|
320
|
+
const bit = 1 << (ordinal & 7);
|
|
321
|
+
if ((filter.bits[index] & bit) === 0) return;
|
|
322
|
+
filter.bits[index] &= ~bit;
|
|
323
|
+
filter.count -= 1;
|
|
324
|
+
}
|
|
325
|
+
function* ordinalFilterValues(filter) {
|
|
326
|
+
const bits = filter.bits;
|
|
327
|
+
for (let index = 0; index < bits.length; index++) {
|
|
328
|
+
const byte = bits[index];
|
|
329
|
+
if (byte === 0) continue;
|
|
330
|
+
for (let offset = 0; offset < 8; offset++) {
|
|
331
|
+
if ((byte & 1 << offset) !== 0) yield index << 3 | offset;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
300
336
|
// src/vector/simd-wasm-binary.ts
|
|
301
337
|
var SIMD_DISTANCE_WASM_BASE64 = "AGFzbQEAAAABIgVgA39/fwF9YAJ/fwF9YAN/f38Bf2ABewF/YAR/f39/AX8DDw4AAQAAAgIDAgIEAgQCAgUDAQABB6QBCgZtZW1vcnkCAAtkb3RfcHJvZHVjdAAACW1hZ25pdHVkZQABGnNxdWFyZWRfZXVjbGlkZWFuX2Rpc3RhbmNlAAISZXVjbGlkZWFuX2Rpc3RhbmNlAAMGZG90X3U4AAQJc3FkaXN0X3U4AAUMb3NxX2RvdF9iaXRzAAkRb3NxX2RvdF9iaXRzX3BhaXIACxNvc3FfZG90X25pYmJsZXNfNHg0AA0K2RQOygIEAX8EewF9BH8gAkFwcSEJIAJBfHEhCv0MAAAAAAAAAAAAAAAAAAAAACEEQQAhAwJAA0AgAyAJTw0BIAAgA0ECdGohCyABIANBAnRqIQwgBCAL/QAEACAM/QAEAP3mAf3kASEEIAUgC/0ABBAgDP0ABBD95gH95AEhBSAGIAv9AAQgIAz9AAQg/eYB/eQBIQYgByAL/QAEMCAM/QAEMP3mAf3kASEHIANBEGohAwwACwsCQANAIAMgCk8NASAEIAAgA0ECdGr9AAQAIAEgA0ECdGr9AAQA/eYB/eQBIQQgA0EEaiEDDAALCyAEIAX95AEgBiAH/eQB/eQBIQQgBP0fACAE/R8BkiAE/R8CIAT9HwOSkiEIAkADQ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gA2otAAAhDyABIANqLQAAIRAgBiAPIBFxIBBxaSAPIBFxIBBBAXYgEnFxaUEBdGogD0EBdiAScSAQIBFxcWlBAXQgD0EBdiAScSAQQQF2IBJxcWlBAnRqamohBiADQQFqIQMMAAsLIAYL/AEDA38IewJ/IAJBcHEhBEEP/Q8hDEEA/REhDUEAIQMCQANAIAMgBE8NASAAIANq/QAEACEGIAEgA2r9AAQAIQcgBiAM/U4hCCAGQQT9bSEJIAcgDP1OIQogB0EE/W0hCyANIAggCv2eASAJIAv9ngH9jgH9fyAIIAr9nwEgCSAL/Z8B/Y4B/X/9rgH9rgEhDSADQRBqIQMMAAsLIA39GwAgDf0bAWogDf0bAiAN/RsDamohBQJAA0AgAyACTw0BIAAgA2otAAAhDyABIANqLQAAIQ4gBSAPQQ9xIA5BD3FsIA9BBHYgDkEEdmxqaiEFIANBAWohAwwACwsgBQs=";
|
|
@@ -1099,8 +1135,18 @@ var STORE_CALIBRATION_GENERATION = 7;
|
|
|
1099
1135
|
var STORE_RELEASED_VECTORS_TO_DISK = 8;
|
|
1100
1136
|
var STORE_UNPLACED_COUNT = 9;
|
|
1101
1137
|
var STORE_REMOVED_COUNT = 10;
|
|
1138
|
+
var STORE_ORDINAL_LAYOUT_GENERATION = 11;
|
|
1102
1139
|
var STORE_HEADER_WORDS = 16;
|
|
1103
1140
|
var IN_MEMORY = -1;
|
|
1141
|
+
function resetStoreHeader(header) {
|
|
1142
|
+
Atomics.store(header, STORE_SLOTS, 0);
|
|
1143
|
+
Atomics.store(header, STORE_RELEASED_VECTORS_TO_DISK, 0);
|
|
1144
|
+
Atomics.store(header, STORE_LIVE_COUNT, 0);
|
|
1145
|
+
Atomics.store(header, STORE_CODE_COUNT, 0);
|
|
1146
|
+
Atomics.store(header, STORE_CALIBRATED, 0);
|
|
1147
|
+
Atomics.add(header, STORE_CALIBRATION_GENERATION, 1);
|
|
1148
|
+
Atomics.add(header, STORE_ORDINAL_LAYOUT_GENERATION, 1);
|
|
1149
|
+
}
|
|
1104
1150
|
function fixedInt32(words) {
|
|
1105
1151
|
return new Int32Array(createFixedBuffer(words * 4), 0, words);
|
|
1106
1152
|
}
|
|
@@ -1338,42 +1384,6 @@ function nativeQuantise(handles, metric, ordinals) {
|
|
|
1338
1384
|
return workOnRecords(handles, metric, ordinals, "quantise");
|
|
1339
1385
|
}
|
|
1340
1386
|
|
|
1341
|
-
// src/vector/ordinal-filter.ts
|
|
1342
|
-
function createOrdinalFilter(slots) {
|
|
1343
|
-
return { bits: new Uint8Array(slots + 7 >>> 3), count: 0 };
|
|
1344
|
-
}
|
|
1345
|
-
function addToOrdinalFilter(filter, ordinal) {
|
|
1346
|
-
const index = ordinal >>> 3;
|
|
1347
|
-
if (index >= filter.bits.length) return;
|
|
1348
|
-
const bit = 1 << (ordinal & 7);
|
|
1349
|
-
if ((filter.bits[index] & bit) !== 0) return;
|
|
1350
|
-
filter.bits[index] |= bit;
|
|
1351
|
-
filter.count += 1;
|
|
1352
|
-
}
|
|
1353
|
-
function ordinalFilterHas(filter, ordinal) {
|
|
1354
|
-
const index = ordinal >>> 3;
|
|
1355
|
-
if (index >= filter.bits.length) return false;
|
|
1356
|
-
return (filter.bits[index] & 1 << (ordinal & 7)) !== 0;
|
|
1357
|
-
}
|
|
1358
|
-
function removeFromOrdinalFilter(filter, ordinal) {
|
|
1359
|
-
const index = ordinal >>> 3;
|
|
1360
|
-
if (index >= filter.bits.length) return;
|
|
1361
|
-
const bit = 1 << (ordinal & 7);
|
|
1362
|
-
if ((filter.bits[index] & bit) === 0) return;
|
|
1363
|
-
filter.bits[index] &= ~bit;
|
|
1364
|
-
filter.count -= 1;
|
|
1365
|
-
}
|
|
1366
|
-
function* ordinalFilterValues(filter) {
|
|
1367
|
-
const bits = filter.bits;
|
|
1368
|
-
for (let index = 0; index < bits.length; index++) {
|
|
1369
|
-
const byte = bits[index];
|
|
1370
|
-
if (byte === 0) continue;
|
|
1371
|
-
for (let offset = 0; offset < 8; offset++) {
|
|
1372
|
-
if ((byte & 1 << offset) !== 0) yield index << 3 | offset;
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
1387
|
// src/vector/native/field.ts
|
|
1378
1388
|
var WAKE_COUNT_WORDS = 1;
|
|
1379
1389
|
var WAKES_THE_CORE_KEEPS_PER_CALL = 256;
|
|
@@ -1954,7 +1964,7 @@ function readNeighborsLocked(state, ord, layer) {
|
|
|
1954
1964
|
if (nodeReadHeld(state.locks, ord, version)) return count;
|
|
1955
1965
|
}
|
|
1956
1966
|
}
|
|
1957
|
-
function searchLayer(state, qVec, qMag, ef, layer, metric, excludeTombstones, distFn, results) {
|
|
1967
|
+
function searchLayer(state, qVec, qMag, ef, layer, metric, excludeTombstones, distFn, results, accepted) {
|
|
1958
1968
|
const getDistance = distFn ?? ((ord) => queryDistanceByOrd(state, qVec, qMag, ord, metric));
|
|
1959
1969
|
const workspace = state.workspace;
|
|
1960
1970
|
const frontier = workspace.frontier;
|
|
@@ -1974,6 +1984,7 @@ function searchLayer(state, qVec, qMag, ef, layer, metric, excludeTombstones, di
|
|
|
1974
1984
|
if (dist === Number.POSITIVE_INFINITY) continue;
|
|
1975
1985
|
pushHeap(frontier, epOrd, dist);
|
|
1976
1986
|
if (excludeTombstones && isTombstoned(state, epOrd)) continue;
|
|
1987
|
+
if (accepted && !ordinalFilterHas(accepted, epOrd)) continue;
|
|
1977
1988
|
pushHeap(found, epOrd, dist);
|
|
1978
1989
|
if (found.size > ef) {
|
|
1979
1990
|
popHeap(found);
|
|
@@ -1994,6 +2005,7 @@ function searchLayer(state, qVec, qMag, ef, layer, metric, excludeTombstones, di
|
|
|
1994
2005
|
if (dist < furthestDist || found.size < ef) {
|
|
1995
2006
|
pushHeap(frontier, neighborOrd, dist);
|
|
1996
2007
|
if (excludeTombstones && isTombstoned(state, neighborOrd)) continue;
|
|
2008
|
+
if (accepted && !ordinalFilterHas(accepted, neighborOrd)) continue;
|
|
1997
2009
|
pushHeap(found, neighborOrd, dist);
|
|
1998
2010
|
if (found.size > ef) {
|
|
1999
2011
|
popHeap(found);
|
|
@@ -2355,7 +2367,7 @@ function copyCandidates(store, count, target) {
|
|
|
2355
2367
|
target.distances.set(store.distances.subarray(0, count));
|
|
2356
2368
|
target.size = count;
|
|
2357
2369
|
}
|
|
2358
|
-
function nativeTraverse(state, field, query, candidateCount, metric, candidates) {
|
|
2370
|
+
function nativeTraverse(state, field, query, candidateCount, metric, filter, candidates) {
|
|
2359
2371
|
const store = field.store;
|
|
2360
2372
|
reserveOrdinals(store, candidateCount);
|
|
2361
2373
|
let count;
|
|
@@ -2368,7 +2380,8 @@ function nativeTraverse(state, field, query, candidateCount, metric, candidates)
|
|
|
2368
2380
|
candidateCount,
|
|
2369
2381
|
state.locks.threadSlot,
|
|
2370
2382
|
store.ordinals,
|
|
2371
|
-
store.distances
|
|
2383
|
+
store.distances,
|
|
2384
|
+
filter === void 0 ? null : filter.bits
|
|
2372
2385
|
);
|
|
2373
2386
|
} catch (error) {
|
|
2374
2387
|
stopUsingTheNativeSearchCore(error);
|
|
@@ -2383,7 +2396,7 @@ function nativeRescoredHits(store, candidates, query, depth, metric, minSimilari
|
|
|
2383
2396
|
reserveOrdinals(store, nearest);
|
|
2384
2397
|
const ordinals = store.ordinals;
|
|
2385
2398
|
let kept = 0;
|
|
2386
|
-
for (let i = 0; i < nearest; i++) {
|
|
2399
|
+
for (let i = 0; i < candidates.size && kept < nearest; i++) {
|
|
2387
2400
|
const ord = candidates.ords[i];
|
|
2388
2401
|
if (filter && !ordinalFilterHas(filter, ord)) continue;
|
|
2389
2402
|
ordinals[kept++] = ord;
|
|
@@ -2400,30 +2413,74 @@ function nativeRescoredHits(store, candidates, query, depth, metric, minSimilari
|
|
|
2400
2413
|
return hits;
|
|
2401
2414
|
}
|
|
2402
2415
|
|
|
2403
|
-
// src/vector/
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2416
|
+
// src/vector/search-depth/constants.ts
|
|
2417
|
+
var NARROW_DIMENSION_LIMIT = 768;
|
|
2418
|
+
var WIDE_DIMENSION_LIMIT = 1024;
|
|
2419
|
+
var DEFAULT_EF_SEARCH_MARGIN_BY_BAND = {
|
|
2420
|
+
narrow: 50,
|
|
2421
|
+
middle: 75,
|
|
2422
|
+
wide: 0
|
|
2423
|
+
};
|
|
2424
|
+
var DEFAULT_RESCORE_DEPTH_FLOOR_PER_LIMIT_BY_BITS = {
|
|
2425
|
+
1: 3,
|
|
2426
|
+
2: 3,
|
|
2427
|
+
4: 1,
|
|
2428
|
+
8: 1
|
|
2429
|
+
};
|
|
2430
|
+
var DEFAULT_RESCORE_DEPTH_BY_BITS = {
|
|
2431
|
+
1: {
|
|
2432
|
+
narrow: { perLimit: 3.23, perSquareRootOfLimit: 55.9 },
|
|
2433
|
+
middle: { perLimit: 2.2, perSquareRootOfLimit: 27 },
|
|
2434
|
+
wide: { perLimit: 3, perSquareRootOfLimit: 0 }
|
|
2435
|
+
},
|
|
2436
|
+
2: {
|
|
2437
|
+
narrow: { perLimit: 2.6, perSquareRootOfLimit: 17 },
|
|
2438
|
+
middle: { perLimit: 1, perSquareRootOfLimit: 16 },
|
|
2439
|
+
wide: { perLimit: 3, perSquareRootOfLimit: 0 }
|
|
2440
|
+
},
|
|
2441
|
+
4: {
|
|
2442
|
+
narrow: { perLimit: 5, perSquareRootOfLimit: 0 },
|
|
2443
|
+
middle: { perLimit: 5, perSquareRootOfLimit: 0 },
|
|
2444
|
+
wide: { perLimit: 2, perSquareRootOfLimit: 0 }
|
|
2445
|
+
},
|
|
2446
|
+
8: {
|
|
2447
|
+
narrow: { perLimit: 2, perSquareRootOfLimit: 0 },
|
|
2448
|
+
middle: { perLimit: 2, perSquareRootOfLimit: 0 },
|
|
2449
|
+
wide: { perLimit: 2, perSquareRootOfLimit: 0 }
|
|
2450
|
+
}
|
|
2451
|
+
};
|
|
2452
|
+
|
|
2453
|
+
// src/vector/search-depth/index.ts
|
|
2454
|
+
function dimensionBand(dimension) {
|
|
2455
|
+
if (dimension < NARROW_DIMENSION_LIMIT) return "narrow";
|
|
2456
|
+
return dimension < WIDE_DIMENSION_LIMIT ? "middle" : "wide";
|
|
2457
|
+
}
|
|
2458
|
+
function defaultRescoreDepth(bits, dimension, k) {
|
|
2459
|
+
const { perLimit, perSquareRootOfLimit } = DEFAULT_RESCORE_DEPTH_BY_BITS[bits][dimensionBand(dimension)];
|
|
2460
|
+
const floor = DEFAULT_RESCORE_DEPTH_FLOOR_PER_LIMIT_BY_BITS[bits] * k;
|
|
2461
|
+
return Math.max(floor, Math.ceil(perLimit * k + perSquareRootOfLimit * Math.sqrt(k)));
|
|
2462
|
+
}
|
|
2463
|
+
function defaultEfSearch(dimension, k) {
|
|
2464
|
+
return Math.max(DEFAULT_EF_SEARCH, k + DEFAULT_EF_SEARCH_MARGIN_BY_BAND[dimensionBand(dimension)]);
|
|
2407
2465
|
}
|
|
2466
|
+
|
|
2467
|
+
// src/vector/hnsw/search.ts
|
|
2408
2468
|
function traverse(state, query, k, searchMetric, options) {
|
|
2409
|
-
const liveSize = nodeCountOf(state) - tombstoneCountOf(state);
|
|
2410
2469
|
const calibrated = activeQuantizer(state);
|
|
2411
2470
|
const quantizer = calibrated === void 0 || calibrated.size === 0 ? void 0 : calibrated;
|
|
2412
2471
|
const useQuantized = quantizer !== void 0;
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
if (filter && filter.count < liveSize) {
|
|
2417
|
-
const selectivity = filter.count / liveSize;
|
|
2418
|
-
ef = Math.max(ef, Math.ceil(k / Math.max(selectivity, 0.01)));
|
|
2419
|
-
ef = Math.min(ef, liveSize);
|
|
2472
|
+
let depth = k;
|
|
2473
|
+
if (quantizer !== void 0) {
|
|
2474
|
+
depth = options.oversample === void 0 ? defaultRescoreDepth(quantizer.bits, state.dimension, k) : Math.ceil(k * options.oversample);
|
|
2420
2475
|
}
|
|
2476
|
+
const ef = Math.max(options.efSearch ?? defaultEfSearch(state.dimension, k), depth);
|
|
2477
|
+
const filter = options.filter;
|
|
2421
2478
|
const workspace = state.workspace;
|
|
2422
2479
|
const candidates = workspace.traversal;
|
|
2423
2480
|
const native = nativeFieldFor(state);
|
|
2424
2481
|
if (native !== null) {
|
|
2425
2482
|
candidates.size = 0;
|
|
2426
|
-
if (nativeTraverse(state, native, query, ef, searchMetric, candidates)) {
|
|
2483
|
+
if (nativeTraverse(state, native, query, ef, searchMetric, filter, candidates)) {
|
|
2427
2484
|
return { candidates, depth: useQuantized ? depth : 0, arenaQuery: null, qMag: 0, native };
|
|
2428
2485
|
}
|
|
2429
2486
|
}
|
|
@@ -2451,7 +2508,7 @@ function traverse(state, query, k, searchMetric, options) {
|
|
|
2451
2508
|
setSingleEntryPoint(workspace, candidates.ords[0]);
|
|
2452
2509
|
}
|
|
2453
2510
|
}
|
|
2454
|
-
searchLayer(state, query, qMag, ef, 0, searchMetric, true, distFn, candidates);
|
|
2511
|
+
searchLayer(state, query, qMag, ef, 0, searchMetric, true, distFn, candidates, filter);
|
|
2455
2512
|
} finally {
|
|
2456
2513
|
unlockGraphShared(state.locks);
|
|
2457
2514
|
}
|
|
@@ -2555,10 +2612,11 @@ function collectHits(state, query, k, searchMetric, minSimilarity, options) {
|
|
|
2555
2612
|
function rescoreWithFullPrecision(state, candidates, query, qMag, arenaQuery, depth, metric, minSimilarity, filter) {
|
|
2556
2613
|
noteFallback("score");
|
|
2557
2614
|
const rescored = [];
|
|
2558
|
-
|
|
2559
|
-
for (let i = 0; i <
|
|
2615
|
+
let taken = 0;
|
|
2616
|
+
for (let i = 0; i < candidates.size && taken < depth; i++) {
|
|
2560
2617
|
const ord = candidates.ords[i];
|
|
2561
2618
|
if (filter && !ordinalFilterHas(filter, ord)) continue;
|
|
2619
|
+
taken += 1;
|
|
2562
2620
|
let fullDistance;
|
|
2563
2621
|
if (arenaQuery) {
|
|
2564
2622
|
fullDistance = state.store.distanceFromArena(arenaQuery, ord, metric);
|
|
@@ -3590,4 +3648,4 @@ function createHNSWIndex(dimension, store, config, quantizer, handles) {
|
|
|
3590
3648
|
};
|
|
3591
3649
|
}
|
|
3592
3650
|
|
|
3593
|
-
export { BLOCK_MAX_BYTES, GRAPH_RETIRED, IN_MEMORY, NOTHING_STAGED, QUERY_STAGED, STORE_BLOCK_COUNT,
|
|
3651
|
+
export { BLOCK_MAX_BYTES, GRAPH_RETIRED, IN_MEMORY, NOTHING_STAGED, QUERY_STAGED, STORE_BLOCK_COUNT, STORE_CALIBRATION_GENERATION, STORE_CODE_BLOCK_COUNT, STORE_DOC_ID_BYTES, STORE_LIVE_COUNT, STORE_ORDINAL_LAYOUT_GENERATION, STORE_RELEASED_VECTORS_TO_DISK, STORE_REMOVED_COUNT, STORE_SLOTS, STORE_UNPLACED_COUNT, addToOrdinalFilter, arenaFloat32Distance, cosineSimilarityWithMagnitudes, createHNSWIndex, createOrdinalFilter, createOsqQuantizer, createSharedVectorStoreHandles, createVectorBlock, detachNativeStore, dotProduct, ensureBlockSlots, euclideanDistance, fixedView, graphWithoutNodes, growBufferTo, insertNode, magnitude, nativeScoresOf, nativeStoreScratchBytes, nodeCountOf, openGraphState, openSharedQuantizer, openVectorBlock, ordinalFilterHas, ordinalFilterValues, osqBitsOf, releaseLocksHeldBy, removeFromOrdinalFilter, requireWholeNeighbourLists, resetStoreHeader, searchOrdinals, sharedMemoryAvailable, sharedVectorStoreBytes, slotByteOffset, toDistance, toScore, tombstoneCountOf, topLayerInParts, unplacedChunkCount };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { english } from './chunk-TGP5M5R7.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
3
|
+
|
|
4
|
+
// src/languages/registry.ts
|
|
5
|
+
var languages = /* @__PURE__ */ new Map();
|
|
6
|
+
languages.set("english", english);
|
|
7
|
+
function registerLanguage(module) {
|
|
8
|
+
languages.set(module.name, module);
|
|
9
|
+
}
|
|
10
|
+
function getLanguage(name) {
|
|
11
|
+
const lang = languages.get(name);
|
|
12
|
+
if (!lang) {
|
|
13
|
+
throw new NarsilError(ErrorCodes.LANGUAGE_NOT_SUPPORTED, `Language "${name}" is not registered`, { language: name });
|
|
14
|
+
}
|
|
15
|
+
return lang;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/core/id-generator.ts
|
|
19
|
+
function generateId() {
|
|
20
|
+
const bytes = new Uint8Array(16);
|
|
21
|
+
crypto.getRandomValues(bytes);
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
bytes[0] = Math.floor(now / 2 ** 40);
|
|
24
|
+
bytes[1] = Math.floor(now / 2 ** 32) % 256;
|
|
25
|
+
bytes[2] = Math.floor(now / 2 ** 24) % 256;
|
|
26
|
+
bytes[3] = Math.floor(now / 2 ** 16) % 256;
|
|
27
|
+
bytes[4] = Math.floor(now / 2 ** 8) % 256;
|
|
28
|
+
bytes[5] = now % 256;
|
|
29
|
+
bytes[6] = bytes[6] & 15 | 112;
|
|
30
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
31
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
32
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { generateId, getLanguage, registerLanguage };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { P as PartitionConfig, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-
|
|
2
|
-
import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult } from './memory-
|
|
3
|
-
import {
|
|
1
|
+
import { P as PartitionConfig, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-DttzM-ln.js';
|
|
2
|
+
import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult } from './memory-wuXcYOD1.js';
|
|
3
|
+
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
4
|
+
import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-Bj9WBlFG.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* This is the `fetch` implementation the client sends every request through.
|
|
@@ -233,6 +234,29 @@ interface AdminOperations {
|
|
|
233
234
|
* ceiling falls below what the index already holds.
|
|
234
235
|
*/
|
|
235
236
|
updatePartitionConfig(indexName: string, partitionConfig: Partial<PartitionConfig>, options?: RequestOptions): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Replaces the synonym set of an index, which takes effect from the next
|
|
239
|
+
* search without a rebuild. Send an empty list to remove the set.
|
|
240
|
+
*
|
|
241
|
+
* @param indexName - The server replaces the set of this index.
|
|
242
|
+
* @param synonyms - This is the new set, in the shape that
|
|
243
|
+
* {@link SynonymRule} describes.
|
|
244
|
+
* @param options - This sets the signal, the deadline, and the headers for
|
|
245
|
+
* this request.
|
|
246
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
|
|
247
|
+
* shape, when a word analyses to no token or to more than one, or when the
|
|
248
|
+
* set passes its limits. The index then keeps the set that it held before.
|
|
249
|
+
*/
|
|
250
|
+
updateSynonyms(indexName: string, synonyms: SynonymRule[], options?: RequestOptions): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Reads the synonym set of an index, with every word as the caller wrote it.
|
|
253
|
+
*
|
|
254
|
+
* @param indexName - The server returns the set of this index.
|
|
255
|
+
* @param options - This sets the signal, the deadline, and the headers for
|
|
256
|
+
* this request.
|
|
257
|
+
* @returns The rules of the set, or an empty list when the index holds none.
|
|
258
|
+
*/
|
|
259
|
+
getSynonyms(indexName: string, options?: RequestOptions): Promise<SynonymRule[]>;
|
|
236
260
|
/**
|
|
237
261
|
* Reanalyses every document in an index, as a task. An index analysed by an
|
|
238
262
|
* earlier revision of its language module must run this before its terms
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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-
|
|
2
|
-
export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, T as TASK_CANCEL_CAPABILITY,
|
|
3
|
-
export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-
|
|
4
|
-
export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-
|
|
5
|
-
import './schema-
|
|
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-wuXcYOD1.js';
|
|
2
|
+
export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-xsJfdFoQ.js';
|
|
3
|
+
export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-Bj9WBlFG.js';
|
|
4
|
+
export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-CgayPw2R.js';
|
|
5
|
+
import './schema-DttzM-ln.js';
|
|
6
6
|
import './adapters-79OIa4xm.js';
|
|
7
|
-
import './
|
|
8
|
-
import './config-
|
|
9
|
-
import './
|
|
7
|
+
import './synonyms-CpOAHPa-.js';
|
|
8
|
+
import './config-3kBsQ0Pi.js';
|
|
9
|
+
import './config-B-RnO6dr.js';
|
|
10
|
+
import './index-ONAEaqtx.js';
|
|
10
11
|
import './types-Cb9kiY5P.js';
|
package/dist/client.mjs
CHANGED
|
@@ -36,6 +36,7 @@ var ErrorCodes = {
|
|
|
36
36
|
ENVELOPE_VERSION_MISMATCH: "ENVELOPE_VERSION_MISMATCH",
|
|
37
37
|
ENVELOPE_INVALID_MAGIC: "ENVELOPE_INVALID_MAGIC",
|
|
38
38
|
PARTITION_CAPACITY_EXCEEDED: "PARTITION_CAPACITY_EXCEEDED",
|
|
39
|
+
RESTORE_MEMORY_EXCEEDED: "RESTORE_MEMORY_EXCEEDED",
|
|
39
40
|
EMBEDDING_FAILED: "EMBEDDING_FAILED",
|
|
40
41
|
EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH",
|
|
41
42
|
EMBEDDING_NO_SOURCE: "EMBEDDING_NO_SOURCE",
|
|
@@ -156,13 +157,15 @@ var TASK_FILTER_CAPABILITY = "tasks.filter";
|
|
|
156
157
|
var REBUILD_ANALYSIS_CAPABILITY = "indexes.rebuildAnalysis";
|
|
157
158
|
var INDEX_LIFECYCLE_CAPABILITY = "indexes.lifecycle";
|
|
158
159
|
var DOCUMENT_EXPORT_CAPABILITY = "indexes.documentExport";
|
|
160
|
+
var SYNONYMS_CAPABILITY = "indexes.synonyms";
|
|
159
161
|
var SERVER_CAPABILITIES = [
|
|
160
162
|
ASYNC_IMPORT_CAPABILITY,
|
|
161
163
|
TASK_CANCEL_CAPABILITY,
|
|
162
164
|
TASK_FILTER_CAPABILITY,
|
|
163
165
|
REBUILD_ANALYSIS_CAPABILITY,
|
|
164
166
|
INDEX_LIFECYCLE_CAPABILITY,
|
|
165
|
-
DOCUMENT_EXPORT_CAPABILITY
|
|
167
|
+
DOCUMENT_EXPORT_CAPABILITY,
|
|
168
|
+
SYNONYMS_CAPABILITY
|
|
166
169
|
];
|
|
167
170
|
|
|
168
171
|
// src/json-encoding.ts
|
|
@@ -307,6 +310,17 @@ function createAdminOperations(transport) {
|
|
|
307
310
|
async updatePartitionConfig(indexName, partitionConfig, options) {
|
|
308
311
|
await postJson(`${indexPath(indexName)}/partition-config`, partitionConfig, options);
|
|
309
312
|
},
|
|
313
|
+
async updateSynonyms(indexName, synonyms, options) {
|
|
314
|
+
await postJson(`${indexPath(indexName)}/synonyms`, { synonyms }, options);
|
|
315
|
+
},
|
|
316
|
+
async getSynonyms(indexName, options) {
|
|
317
|
+
const path = `${indexPath(indexName)}/synonyms`;
|
|
318
|
+
const body = await readBody(
|
|
319
|
+
await transport.json({ method: "GET", path, options }),
|
|
320
|
+
path
|
|
321
|
+
);
|
|
322
|
+
return body.synonyms;
|
|
323
|
+
},
|
|
310
324
|
async rebuildAnalysis(indexName, options) {
|
|
311
325
|
const path = `${indexPath(indexName)}/_rebuild-analysis`;
|
|
312
326
|
return readBody(await transport.json({ method: "POST", path, options }), path);
|
|
@@ -897,4 +911,4 @@ function createNarsilClient(options) {
|
|
|
897
911
|
};
|
|
898
912
|
}
|
|
899
913
|
|
|
900
|
-
export { ASYNC_IMPORT_CAPABILITY, ClientErrorCodes, DOCUMENT_EXPORT_CAPABILITY, ErrorCodes, INDEX_LIFECYCLE_CAPABILITY, NarsilError, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, ServerErrorCodes, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, createNarsilClient, isNarsilError };
|
|
914
|
+
export { ASYNC_IMPORT_CAPABILITY, ClientErrorCodes, DOCUMENT_EXPORT_CAPABILITY, ErrorCodes, INDEX_LIFECYCLE_CAPABILITY, NarsilError, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, SYNONYMS_CAPABILITY, ServerErrorCodes, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, createNarsilClient, isNarsilError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NarsilConfig } from './config-
|
|
2
|
-
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-
|
|
1
|
+
import { N as NarsilConfig } from './config-B-RnO6dr.js';
|
|
2
|
+
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-ONAEaqtx.js';
|
|
3
3
|
import { N as NodeTransport } from './types-Cb9kiY5P.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
|
-
import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-
|
|
3
|
-
import { I as IndexConfig, A as AnyDocument } from './schema-
|
|
2
|
+
import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-wuXcYOD1.js';
|
|
3
|
+
import { I as IndexConfig, A as AnyDocument } from './schema-DttzM-ln.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Hooks that the engine calls alongside its own work, so that an application
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { createDirectExecutor } from './chunk-UAUZGXJP.mjs';
|
|
2
|
+
import './chunk-CHOGQSHK.mjs';
|
|
3
|
+
import './chunk-ZHS44YKF.mjs';
|
|
4
|
+
import './chunk-TGP5M5R7.mjs';
|
|
5
|
+
import './chunk-U2BKYEC7.mjs';
|
|
6
|
+
import './chunk-QM3VPX4Z.mjs';
|
|
7
|
+
import './chunk-WQBCBKY3.mjs';
|
|
8
|
+
import './chunk-SBCEHIPL.mjs';
|
|
9
|
+
import './chunk-4ZJWRETC.mjs';
|
|
10
|
+
import './chunk-FGMGUDHX.mjs';
|
|
11
|
+
import './chunk-KEHK2O6P.mjs';
|
|
12
|
+
import './chunk-GES7U2PM.mjs';
|
|
13
|
+
import './chunk-BB7MASRQ.mjs';
|
|
14
|
+
import './chunk-2GZGBOQI.mjs';
|
|
15
|
+
import './chunk-X5CV2E2B.mjs';
|
|
16
|
+
import './chunk-7X5JST5L.mjs';
|
|
17
|
+
import './chunk-7KC56574.mjs';
|
|
18
|
+
import './chunk-R6A773WK.mjs';
|
|
19
|
+
import './chunk-YTJCGKM4.mjs';
|
|
20
|
+
import './chunk-K6A4FCVR.mjs';
|
|
21
|
+
import './chunk-L5ORED7V.mjs';
|
|
22
|
+
import './chunk-SYWGORQB.mjs';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { C as ClusterCoordinator } from '../../index-
|
|
2
|
-
import '../../schema-
|
|
1
|
+
import { C as ClusterCoordinator } from '../../index-ONAEaqtx.js';
|
|
2
|
+
import '../../schema-DttzM-ln.js';
|
|
3
3
|
import '../../adapters-79OIa4xm.js';
|
|
4
|
+
import '../../synonyms-CpOAHPa-.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Configures where {@link createEtcdCoordinator} connects, how long etcd keeps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MAX_NODE_ID_LENGTH, MAX_WATCHERS } from '../../chunk-ORBLD3EL.mjs';
|
|
2
2
|
import '../../chunk-R6A773WK.mjs';
|
|
3
3
|
import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from '../../chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from '../../chunk-SYWGORQB.mjs';
|
|
5
5
|
import { decode, encode } from '@msgpack/msgpack';
|
|
6
6
|
|
|
7
7
|
// src/distribution/coordinator/etcd/constants.ts
|
|
@@ -329,6 +329,10 @@ function storedValueMethods(context) {
|
|
|
329
329
|
return txn.succeeded;
|
|
330
330
|
});
|
|
331
331
|
},
|
|
332
|
+
async delete(key) {
|
|
333
|
+
assertNotShutdown();
|
|
334
|
+
await client.delete().key(keys.generic(key)).exec();
|
|
335
|
+
},
|
|
332
336
|
async getSchema(indexName) {
|
|
333
337
|
assertNotShutdown();
|
|
334
338
|
const key = keys.schema(indexName);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { C as ClusterCoordinator } from '../../index-
|
|
2
|
-
import '../../schema-
|
|
1
|
+
import { C as ClusterCoordinator } from '../../index-ONAEaqtx.js';
|
|
2
|
+
import '../../schema-DttzM-ln.js';
|
|
3
3
|
import '../../adapters-79OIa4xm.js';
|
|
4
|
+
import '../../synonyms-CpOAHPa-.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Builds a coordinator that holds the cluster's shared state in one process's
|
|
@@ -230,6 +230,10 @@ function createInMemoryCoordinator() {
|
|
|
230
230
|
kvStore.set(key, new Uint8Array(value));
|
|
231
231
|
return true;
|
|
232
232
|
},
|
|
233
|
+
async delete(key) {
|
|
234
|
+
assertNotShutdown();
|
|
235
|
+
kvStore.delete(key);
|
|
236
|
+
},
|
|
233
237
|
async getSchema(indexName) {
|
|
234
238
|
assertNotShutdown();
|
|
235
239
|
return schemas.get(indexName) ?? null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-
|
|
1
|
+
import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-RSRVGAIQ.mjs';
|
|
2
2
|
import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
|
|
3
|
-
import { TransportError, TransportErrorCodes } from '../../chunk-
|
|
4
|
-
import { NarsilError, ErrorCodes } from '../../chunk-
|
|
3
|
+
import { TransportError, TransportErrorCodes } from '../../chunk-OHP7QR33.mjs';
|
|
4
|
+
import { NarsilError, ErrorCodes } from '../../chunk-SYWGORQB.mjs';
|
|
5
5
|
|
|
6
6
|
// src/distribution/transport/grpc/codec.ts
|
|
7
7
|
var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
|
|
2
|
-
import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-
|
|
2
|
+
import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-OHP7QR33.mjs';
|
|
3
3
|
|
|
4
4
|
// src/distribution/transport/in-memory.ts
|
|
5
5
|
function createInMemoryNetwork() {
|