@delali/narsil 0.3.1-next.189 → 0.3.1-next.193
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/browser/{chunk-WFQLSNCO.mjs → chunk-UQG4HUGQ.mjs} +59 -32
- package/dist/browser/{module-VOTN3Q6X.mjs → module-ZZTNG5JZ.mjs} +11 -3
- package/dist/browser/{storage-leaf-62LA56U2.mjs → storage-leaf-N3JMQ6CF.mjs} +15 -12
- package/dist/{chunk-X2NE4VJI.mjs → chunk-2HVQYOOD.mjs} +2 -2
- package/dist/{chunk-REBDKXAH.mjs → chunk-3N5GUXBI.mjs} +2 -2
- package/dist/{chunk-EFS5GVBK.mjs → chunk-5CIHQIA4.mjs} +4 -4
- package/dist/{chunk-IDWDYS2N.mjs → chunk-62X472AC.mjs} +1 -1
- package/dist/{chunk-ZGMCJXY5.mjs → chunk-6MC6BCXK.mjs} +2 -2
- package/dist/{chunk-NM2ITITI.mjs → chunk-7X4IIREW.mjs} +3 -3
- package/dist/{chunk-GYLRKKUT.mjs → chunk-D2EJUM4A.mjs} +4 -4
- package/dist/{chunk-JOWXHENJ.mjs → chunk-FGOGT273.mjs} +2 -2
- package/dist/{chunk-3OZ2UQJV.mjs → chunk-GLXLSPLO.mjs} +2 -2
- package/dist/{chunk-IWKYAO45.mjs → chunk-HHYQMGPW.mjs} +1 -1
- package/dist/{chunk-JXDY3ZA3.mjs → chunk-HSA3H3VW.mjs} +64 -37
- package/dist/{chunk-YQ4RZIIN.mjs → chunk-JENWA4WX.mjs} +1 -1
- package/dist/{chunk-YFMM7QOT.mjs → chunk-JXINPXRS.mjs} +1 -1
- package/dist/{chunk-JEMK23OY.mjs → chunk-K5GNK5GE.mjs} +2 -2
- package/dist/{chunk-PZYBWMCL.mjs → chunk-KOA6T2IC.mjs} +1 -1
- package/dist/{chunk-5HPILB7R.mjs → chunk-PAPQGC6I.mjs} +1 -1
- package/dist/{chunk-6G3VRWH5.mjs → chunk-SB5HCIIO.mjs} +2 -2
- package/dist/{chunk-U5IMECEX.mjs → chunk-SHES4VP5.mjs} +5 -5
- package/dist/{chunk-7NCVV3ST.mjs → chunk-SIIDIGKI.mjs} +1 -1
- package/dist/{chunk-PLLKT5NU.mjs → chunk-SM2SYVIX.mjs} +1 -1
- package/dist/{chunk-P2IPUYT2.mjs → chunk-SMLUZGSI.mjs} +6 -5
- package/dist/{chunk-NFAWR2O4.mjs → chunk-TSE2VWPX.mjs} +1 -1
- package/dist/{chunk-NULDX3ID.mjs → chunk-YPEJ6ODL.mjs} +9 -9
- package/dist/{chunk-3JRN23HA.mjs → chunk-Z6SIJH5O.mjs} +2 -2
- package/dist/{chunk-PPD4J2JI.mjs → chunk-ZVZYJIIP.mjs} +2 -2
- package/dist/{direct-executor-QLBSVTEE.mjs → direct-executor-WSZALYCV.mjs} +1 -1
- package/dist/distribution.mjs +26 -26
- package/dist/index.browser.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.react-native.mjs +1 -1
- package/dist/{long-query-thread-IKD4Z37M.mjs → long-query-thread-N2DNPEA3.mjs} +10 -10
- package/dist/{module-NIVZ4SF2.mjs → module-UQFIJQMG.mjs} +12 -4
- package/dist/{optional-writes-DVTVX2XY.mjs → optional-writes-CGDBJBHQ.mjs} +3 -3
- package/dist/{paged-partition-archive-ES4Z5SM4.mjs → paged-partition-archive-UK44CVXG.mjs} +9 -9
- package/dist/partial-words.browser.mjs +1 -1
- package/dist/partial-words.mjs +1 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +7 -7
- package/dist/{query-actions-IC5UEWZG.mjs → query-actions-7BL3YZDW.mjs} +1 -1
- package/dist/query-suggestions/merge-worker.mjs +4 -4
- package/dist/query-suggestions.browser.mjs +1 -1
- package/dist/query-suggestions.mjs +2 -2
- package/dist/react-native/chunks/{chunk-XLYQ2ZMC.mjs → chunk-63DZ26X5.mjs} +64 -37
- package/dist/react-native/chunks/{chunk-3553RYCS.mjs → chunk-BNFGA7TY.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-FJHZWUCB.mjs → chunk-IP3QLETQ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-JZOHEHBD.mjs → chunk-LOKGE4OQ.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-VSN76LWE.mjs → chunk-UYAZLGEM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-GXY4R3GA.mjs → chunk-XHYOQ4K4.mjs} +1 -1
- package/dist/react-native/chunks/{module-TN7HXWJ3.mjs → module-QRCYB7QV.mjs} +12 -4
- package/dist/react-native/chunks/{optional-writes-2UPNQNAN.mjs → optional-writes-GC6JWMAF.mjs} +2 -2
- package/dist/react-native/chunks/{restore-queue-DEAWTVHW.mjs → restore-queue-2ACONS4W.mjs} +4 -4
- package/dist/react-native/chunks/{segment-codec-leaf-3LZ6HZFD.mjs → segment-codec-leaf-SSIWXVUG.mjs} +2 -2
- package/dist/react-native/chunks/{segment-merge-leaf-5OIWAPCI.mjs → segment-merge-leaf-I2WDFE6O.mjs} +3 -3
- package/dist/react-native/chunks/{storage-leaf-LC4RZU3T.mjs → storage-leaf-YXXMG4VR.mjs} +20 -17
- package/dist/react-native/chunks/{store-leaf-LQ6LWM2Q.mjs → store-leaf-FS7A4PZA.mjs} +3 -3
- package/dist/react-native/chunks/{suggestions-leaf-GPNU6I72.mjs → suggestions-leaf-PSFCT5EX.mjs} +3 -3
- package/dist/react-native/chunks/{worker-copies-32TCHOYP.mjs → worker-copies-QRMISMEL.mjs} +2 -2
- package/dist/react-native/partial-words.mjs +1 -1
- package/dist/react-native/query-suggestions.mjs +1 -1
- package/dist/react-native/sync.mjs +1 -1
- package/dist/react-native/synonyms.mjs +1 -1
- package/dist/{rerank-ELMGHQ3T.mjs → rerank-4GFC26FD.mjs} +1 -1
- package/dist/{restore-queue-6VCVZT5C.mjs → restore-queue-E4EIUYVV.mjs} +4 -4
- package/dist/{segment-codec-leaf-XNMCUIJF.mjs → segment-codec-leaf-MP6DILVE.mjs} +2 -2
- package/dist/{segment-merge-leaf-RA4S7CC6.mjs → segment-merge-leaf-ED2NMUC5.mjs} +2 -2
- package/dist/server.mjs +15 -15
- package/dist/{storage-leaf-36SAEVV3.mjs → storage-leaf-HQFO37W7.mjs} +30 -28
- package/dist/{store-leaf-QAGHHLEK.mjs → store-leaf-PL2G7RM5.mjs} +3 -3
- package/dist/{suggestions-leaf-JG2IP2VQ.mjs → suggestions-leaf-I3MEHACP.mjs} +5 -5
- package/dist/sync/filesystem.mjs +4 -4
- package/dist/sync.browser.mjs +1 -1
- package/dist/sync.mjs +1 -1
- package/dist/synonyms.browser.mjs +1 -1
- package/dist/synonyms.mjs +1 -1
- package/dist/{thread-HAE2XXFR.mjs → thread-LTFI3RK5.mjs} +9 -9
- package/dist/{worker-copies-IXC43Z4Q.mjs → worker-copies-P7YWXEP5.mjs} +4 -4
- package/dist/workers/entry.mjs +7 -7
- package/package.json +5 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, storedText, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, discardStoredValues, storedValuesOf, bitsetHas, createBitSet,
|
|
1
|
+
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, storedText, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, discardStoredValues, bitsetIsEmpty, storedValuesOf, bitsetHas, createBitSet, bitsetSet, storedValueBytes, prepareStoredValues, cachedStoredFields, bitsetClear, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, buildStoredValues, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, checkedSize, fuzzyPrefixOf, boundedLevenshtein, installStoredFields, FILTER_OPERAND_COPY_DEPTH, fuzzyTermMatches, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES, bitsetIterator, GrowableUint32, bitsetFromSet } from './chunk-QAOVAYAG.mjs';
|
|
2
2
|
import { newSyncEpoch, isSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
3
|
-
import { parsedTypeOf, NarsilError, ErrorCodes, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, createNarsilError, withUnpairedSurrogatesReplaced, tokenizeOptions, getNestedValue, isPlainObject, MAX_NESTING_DEPTH, loadMessagePack, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, extractVectorFieldsFromSchema, loadedMessagePack, flattenSchema, vectorDimensionOf, isSingleStringFieldType, schemaFieldsOf, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isStringValuedBase, compareCodePoints, isWordIndexedFieldType, messagePackUpperBoundBytes, toComparableSortValue, exceedsCodePoints, SORT_VALUE_MAX_CODE_POINTS, PROTOTYPE_POLLUTION_KEYS,
|
|
3
|
+
import { parsedTypeOf, NarsilError, ErrorCodes, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, createNarsilError, withUnpairedSurrogatesReplaced, tokenizeOptions, getNestedValue, isPlainObject, MAX_NESTING_DEPTH, loadMessagePack, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, extractVectorFieldsFromSchema, loadedMessagePack, flattenSchema, vectorDimensionOf, isSingleStringFieldType, schemaFieldsOf, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isStringValuedBase, compareCodePoints, isWordIndexedFieldType, messagePackUpperBoundBytes, toComparableSortValue, exceedsCodePoints, SORT_VALUE_MAX_CODE_POINTS, PROTOTYPE_POLLUTION_KEYS, sortModeOf, defaultSortMode, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, getOrCreateFieldNameIndex, isWordIndexedBase, holdsUnpairedSurrogate, validateRequiredFields, requireDocumentWithinSizeLimit, isNarsilError, PLACEMENT_ROOM_REQUESTS, NEAREST_LINK_FALLBACK_HOSTS, MIN_M, MAX_M, MAX_LAYER_CAP, MAX_FILE_BYTES, INITIAL_UPPER_SLOTS, INITIAL_LIST_CAPACITY, FARTHEST_REJECTED_LINKS_KEPT, EARLIER_RELEASE_MIN_M, DEFAULT_EF_SEARCH, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, CONNECT_RESTARTS_BEFORE_ONE_PASS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, VALID_HNSW_METRICS, MAX_DOCUMENT_NESTING_DEPTH, NATIVE_CRC32_MIN_BYTES, CHECKSUM_YIELD_CHUNK_BYTES, raiseEarlierReleaseGraphSetting, MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, withSortableOption, VECTOR_PATTERN, isListBase, isGeopointOrVectorType, MAX_COVERING_CELLS, LOCATION_CODE_BITS_PER_AXIS, LOCATION_CELLS_PER_AXIS, FULL_TURN_DEGREES, EARTH_RADIUS_METERS, DEG_TO_RAD, ANTIMERIDIAN_SPAN_DEGREES, truncateSortString, SORT_MODES, isSortMode, codePointCount } from './chunk-YINZFPLT.mjs';
|
|
4
4
|
|
|
5
5
|
// src/analysis/registry.ts
|
|
6
6
|
var tokenizers = /* @__PURE__ */ new Map();
|
|
@@ -13867,7 +13867,7 @@ var loadVectorCore = vectorCore.load;
|
|
|
13867
13867
|
|
|
13868
13868
|
// src/workers/vector-code.ts
|
|
13869
13869
|
var vectorCode = codeLoader(async () => {
|
|
13870
|
-
const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-
|
|
13870
|
+
const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-ZZTNG5JZ.mjs')]);
|
|
13871
13871
|
code7.bindVectorHost(optionalCodeHost(), vectorCore2);
|
|
13872
13872
|
return code7;
|
|
13873
13873
|
}, "vector");
|
|
@@ -14137,7 +14137,7 @@ async function dropEngineIndex(core2, name) {
|
|
|
14137
14137
|
throw error;
|
|
14138
14138
|
}
|
|
14139
14139
|
}
|
|
14140
|
-
if (core2.executor.getManager(name) !== void 0) core2.executor.dropIndex(name);
|
|
14140
|
+
if (core2.executor.getManager(name) !== void 0) await core2.executor.dropIndex(name);
|
|
14141
14141
|
core2.indexRegistry.delete(name);
|
|
14142
14142
|
core2.watermarkNotifier.forget(name);
|
|
14143
14143
|
core2.analysisRebuild.clearStale(name);
|
|
@@ -18283,14 +18283,27 @@ function ownReadsOf(current, vectorIndexes) {
|
|
|
18283
18283
|
}
|
|
18284
18284
|
};
|
|
18285
18285
|
}
|
|
18286
|
-
function
|
|
18286
|
+
function createSearchRetirement(pins, indexName, pending = /* @__PURE__ */ new Map()) {
|
|
18287
|
+
return (free) => {
|
|
18288
|
+
pins.afterRelease(() => {
|
|
18289
|
+
const disposal = free();
|
|
18290
|
+
if (disposal === void 0) return;
|
|
18291
|
+
pending.set(disposal, indexName);
|
|
18292
|
+
void disposal.then(
|
|
18293
|
+
() => pending.delete(disposal),
|
|
18294
|
+
() => pending.delete(disposal)
|
|
18295
|
+
);
|
|
18296
|
+
});
|
|
18297
|
+
const disposals = [...pending].filter(([, owner]) => owner === indexName).map(([disposal]) => disposal);
|
|
18298
|
+
return Promise.all(disposals).then(() => void 0);
|
|
18299
|
+
};
|
|
18300
|
+
}
|
|
18301
|
+
function replaceVectorIndexes(current, replacement, retire) {
|
|
18287
18302
|
const kept = new Set(replacement.values());
|
|
18288
18303
|
const retired = [...current.values()].filter((index) => !kept.has(index));
|
|
18289
18304
|
current.clear();
|
|
18290
18305
|
for (const [field, index] of replacement) current.set(field, index);
|
|
18291
|
-
|
|
18292
|
-
for (const index of retired) index.dispose();
|
|
18293
|
-
});
|
|
18306
|
+
return retire(() => Promise.all(retired.map((index) => index.dispose())).then(() => void 0));
|
|
18294
18307
|
}
|
|
18295
18308
|
function watchVectorWritesFor(vectorIndexes, pins) {
|
|
18296
18309
|
const watched = /* @__PURE__ */ new Map();
|
|
@@ -18822,7 +18835,7 @@ function partitionStatsOf(partitions) {
|
|
|
18822
18835
|
}
|
|
18823
18836
|
|
|
18824
18837
|
// src/partitioning/manager/index.ts
|
|
18825
|
-
function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes) {
|
|
18838
|
+
function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes, pendingDisposals) {
|
|
18826
18839
|
let config = initialConfig;
|
|
18827
18840
|
let language = initialLanguage;
|
|
18828
18841
|
requirePatternSearchFor(config.schema);
|
|
@@ -18837,6 +18850,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
18837
18850
|
const docPartitionMap = createDocIdMap();
|
|
18838
18851
|
const writeLogs = createWriteLogRecorder();
|
|
18839
18852
|
const pins = createStatePins(() => [...vecIndexes.keys()]);
|
|
18853
|
+
const afterSearchesRelease = createSearchRetirement(pins, indexName, pendingDisposals);
|
|
18840
18854
|
const vectorWrites = watchVectorWritesFor(vecIndexes, pins);
|
|
18841
18855
|
const ownReads = ownReadsOf({ locate: locateDocument, partitionOf }, vecIndexes);
|
|
18842
18856
|
for (let i = 0; i < count; i++) {
|
|
@@ -19064,9 +19078,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
19064
19078
|
vectorWrites.watch();
|
|
19065
19079
|
return pins.open(reads ?? ownReads.current());
|
|
19066
19080
|
},
|
|
19067
|
-
afterSearchesRelease
|
|
19068
|
-
pins.afterRelease(free);
|
|
19069
|
-
},
|
|
19081
|
+
afterSearchesRelease,
|
|
19070
19082
|
fieldValues(docId, fieldPaths) {
|
|
19071
19083
|
const pid = locateDocument(docId);
|
|
19072
19084
|
return pid === void 0 ? void 0 : partitions[pid].fieldValues(docId, fieldPaths);
|
|
@@ -19125,7 +19137,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
19125
19137
|
return vecIndexes;
|
|
19126
19138
|
},
|
|
19127
19139
|
resetVectorIndexes(newIndexes) {
|
|
19128
|
-
replaceVectorIndexes(vecIndexes, newIndexes,
|
|
19140
|
+
return replaceVectorIndexes(vecIndexes, newIndexes, afterSearchesRelease);
|
|
19129
19141
|
}
|
|
19130
19142
|
};
|
|
19131
19143
|
return manager;
|
|
@@ -19191,7 +19203,7 @@ var storageCode = codeLoader(async () => {
|
|
|
19191
19203
|
loadSegmentMerge(),
|
|
19192
19204
|
loadSuggestionStore(),
|
|
19193
19205
|
loadVectorCore(),
|
|
19194
|
-
import('./storage-leaf-
|
|
19206
|
+
import('./storage-leaf-N3JMQ6CF.mjs')
|
|
19195
19207
|
]);
|
|
19196
19208
|
code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
|
|
19197
19209
|
return code7;
|
|
@@ -20476,12 +20488,30 @@ function vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGrap
|
|
|
20476
20488
|
}
|
|
20477
20489
|
function disposeEntry(entry) {
|
|
20478
20490
|
closeCopyPublicationOrder(entry.copyPublications);
|
|
20479
|
-
entry.manager.afterSearchesRelease(() => {
|
|
20480
|
-
|
|
20491
|
+
return entry.manager.afterSearchesRelease(() => {
|
|
20492
|
+
const disposals = [...entry.vectorIndexes.values()].map((vectorIndex) => vectorIndex.dispose());
|
|
20481
20493
|
closeHeldVectorCopies(entry.vectorCopies);
|
|
20482
20494
|
for (const partition of entry.manager.getAllPartitions()) partition.clear();
|
|
20495
|
+
return Promise.all(disposals).then(() => void 0);
|
|
20483
20496
|
});
|
|
20484
20497
|
}
|
|
20498
|
+
function createEntryBuilder(vectorStorage, onVectorGraphRepaired, pendingDisposals) {
|
|
20499
|
+
return (indexName, config, language, analysisStale, awaitedCopyLoad, copies, savedPartitionCount) => {
|
|
20500
|
+
const router = createPartitionRouter();
|
|
20501
|
+
const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
|
|
20502
|
+
const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGraphRepaired);
|
|
20503
|
+
const manager = createPartitionManager(
|
|
20504
|
+
indexName,
|
|
20505
|
+
config,
|
|
20506
|
+
language,
|
|
20507
|
+
router,
|
|
20508
|
+
partitionCount,
|
|
20509
|
+
vectorIndexes,
|
|
20510
|
+
pendingDisposals
|
|
20511
|
+
);
|
|
20512
|
+
return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
|
|
20513
|
+
};
|
|
20514
|
+
}
|
|
20485
20515
|
function indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad) {
|
|
20486
20516
|
return {
|
|
20487
20517
|
manager,
|
|
@@ -20517,6 +20547,8 @@ function createDirectExecutor(options) {
|
|
|
20517
20547
|
const vectorWorkerCopies = options?.vectorWorkerCopies ?? NO_VECTOR_WORKER_COPIES;
|
|
20518
20548
|
const threadSlot = options?.threadSlot ?? 0;
|
|
20519
20549
|
const vectorStorage = options?.vectorStorage ?? "memory";
|
|
20550
|
+
const pendingDisposals = /* @__PURE__ */ new Map();
|
|
20551
|
+
const buildEntry = createEntryBuilder(vectorStorage, options?.onVectorGraphRepaired, pendingDisposals);
|
|
20520
20552
|
function requireIndex(indexName) {
|
|
20521
20553
|
const entry = indexes.get(indexName);
|
|
20522
20554
|
if (!entry) {
|
|
@@ -20550,21 +20582,15 @@ function createDirectExecutor(options) {
|
|
|
20550
20582
|
indexes.set(indexName, entry);
|
|
20551
20583
|
return entry.manager;
|
|
20552
20584
|
}
|
|
20553
|
-
function
|
|
20554
|
-
const
|
|
20555
|
-
const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
|
|
20556
|
-
const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, options?.onVectorGraphRepaired);
|
|
20557
|
-
const manager = createPartitionManager(indexName, config, language, router, partitionCount, vectorIndexes);
|
|
20558
|
-
return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
|
|
20559
|
-
}
|
|
20560
|
-
function dropIndex(indexName) {
|
|
20561
|
-
disposeEntry(requireIndex(indexName));
|
|
20585
|
+
async function dropIndex(indexName) {
|
|
20586
|
+
const entry = requireIndex(indexName);
|
|
20562
20587
|
indexes.delete(indexName);
|
|
20588
|
+
await disposeEntry(entry);
|
|
20563
20589
|
}
|
|
20564
|
-
function installDetachedIndex(detached) {
|
|
20590
|
+
async function installDetachedIndex(detached) {
|
|
20565
20591
|
const previous = indexes.get(detached.indexName);
|
|
20566
20592
|
indexes.set(detached.indexName, detached.entry);
|
|
20567
|
-
if (previous !== void 0 && previous !== detached.entry) disposeEntry(previous);
|
|
20593
|
+
if (previous !== void 0 && previous !== detached.entry) await disposeEntry(previous);
|
|
20568
20594
|
}
|
|
20569
20595
|
function listIndexes() {
|
|
20570
20596
|
return Array.from(indexes.keys());
|
|
@@ -20626,7 +20652,7 @@ function createDirectExecutor(options) {
|
|
|
20626
20652
|
options?.initializeCopyPublication?.(entry, action.publication, threadSlot);
|
|
20627
20653
|
}
|
|
20628
20654
|
} catch (err) {
|
|
20629
|
-
dropIndex(action.indexName);
|
|
20655
|
+
await dropIndex(action.indexName);
|
|
20630
20656
|
throw err;
|
|
20631
20657
|
}
|
|
20632
20658
|
return void 0;
|
|
@@ -20637,7 +20663,7 @@ function createDirectExecutor(options) {
|
|
|
20637
20663
|
return void 0;
|
|
20638
20664
|
}
|
|
20639
20665
|
case "dropIndex": {
|
|
20640
|
-
dropIndex(action.indexName);
|
|
20666
|
+
await dropIndex(action.indexName);
|
|
20641
20667
|
return void 0;
|
|
20642
20668
|
}
|
|
20643
20669
|
case "loadVectorCopy": {
|
|
@@ -20725,7 +20751,7 @@ function createDirectExecutor(options) {
|
|
|
20725
20751
|
case "clear": {
|
|
20726
20752
|
const entry = requireIndex(action.indexName);
|
|
20727
20753
|
entry.manager.clearPartitions();
|
|
20728
|
-
entry.manager.resetVectorIndexes(
|
|
20754
|
+
await entry.manager.resetVectorIndexes(
|
|
20729
20755
|
vectorIndexesFor(
|
|
20730
20756
|
action.indexName,
|
|
20731
20757
|
entry.config,
|
|
@@ -20763,6 +20789,7 @@ function createDirectExecutor(options) {
|
|
|
20763
20789
|
await entry.manager.publication.write(() => disposeEntry(entry));
|
|
20764
20790
|
}
|
|
20765
20791
|
indexes.clear();
|
|
20792
|
+
await Promise.all(pendingDisposals.keys());
|
|
20766
20793
|
return void 0;
|
|
20767
20794
|
}
|
|
20768
20795
|
}
|
|
@@ -21386,7 +21413,7 @@ function wireIndexState(wiring) {
|
|
|
21386
21413
|
} catch (error) {
|
|
21387
21414
|
await orchestrator.closeIndex(indexName).catch(() => void 0);
|
|
21388
21415
|
await durability.manager.unloadIndex(indexName).catch(() => void 0);
|
|
21389
|
-
if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
|
|
21416
|
+
if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
|
|
21390
21417
|
throw error;
|
|
21391
21418
|
}
|
|
21392
21419
|
},
|
|
@@ -21404,7 +21431,7 @@ function wireIndexState(wiring) {
|
|
|
21404
21431
|
try {
|
|
21405
21432
|
await wiring.onClose?.(indexName);
|
|
21406
21433
|
} finally {
|
|
21407
|
-
if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
|
|
21434
|
+
if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
|
|
21408
21435
|
const entry = indexRegistry.get(indexName);
|
|
21409
21436
|
if (entry !== void 0) {
|
|
21410
21437
|
entry.documentCount = documentCount;
|
|
@@ -4332,6 +4332,7 @@ function cancelColdHold(state) {
|
|
|
4332
4332
|
const hold = state.cold;
|
|
4333
4333
|
if (hold === null) return;
|
|
4334
4334
|
state.cold = null;
|
|
4335
|
+
hold.loadWanted();
|
|
4335
4336
|
hold.field.close();
|
|
4336
4337
|
}
|
|
4337
4338
|
function openColdField(state, field, load) {
|
|
@@ -4347,7 +4348,7 @@ function openColdField(state, field, load) {
|
|
|
4347
4348
|
loadWanted = resolve;
|
|
4348
4349
|
});
|
|
4349
4350
|
const hold = beginColdHold(state, field, loaded, loadWanted);
|
|
4350
|
-
|
|
4351
|
+
const settled = load(
|
|
4351
4352
|
(shape) => beginCheckpointRestore(state, shape),
|
|
4352
4353
|
() => state.cold === hold,
|
|
4353
4354
|
loadingWanted
|
|
@@ -4355,6 +4356,7 @@ function openColdField(state, field, load) {
|
|
|
4355
4356
|
if (state.cold === hold) endColdHold(state);
|
|
4356
4357
|
}).then(finished, failed);
|
|
4357
4358
|
loaded.catch(() => void 0);
|
|
4359
|
+
return settled;
|
|
4358
4360
|
}
|
|
4359
4361
|
function coldHas(hold, docId) {
|
|
4360
4362
|
if (hold.written.has(docId)) return true;
|
|
@@ -5589,6 +5591,12 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
5589
5591
|
return state.store.has(docId) && !state.tombstones.has(docId);
|
|
5590
5592
|
}
|
|
5591
5593
|
const whenLoaded = () => untilColdLoaded(state);
|
|
5594
|
+
const coldLoadsInFlight = /* @__PURE__ */ new Set();
|
|
5595
|
+
function openColdFieldTracked(field, load) {
|
|
5596
|
+
const settled = openColdField(state, field, load);
|
|
5597
|
+
coldLoadsInFlight.add(settled);
|
|
5598
|
+
void settled.then(() => coldLoadsInFlight.delete(settled));
|
|
5599
|
+
}
|
|
5592
5600
|
async function searchParallel(query, k, options) {
|
|
5593
5601
|
if (state.graphsHeldOffThread !== null) await untilGraphReleased(state);
|
|
5594
5602
|
if (state.cold !== null) return coldSearchConcurrently(state, state.cold, query, k, options);
|
|
@@ -5672,7 +5680,7 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
5672
5680
|
},
|
|
5673
5681
|
dispose: () => {
|
|
5674
5682
|
cancelColdHold(state);
|
|
5675
|
-
return disposeIndex(state).then(closeIdleTurnHop);
|
|
5683
|
+
return Promise.all([disposeIndex(state), ...coldLoadsInFlight]).then(closeIdleTurnHop);
|
|
5676
5684
|
},
|
|
5677
5685
|
search: withGraphFree(
|
|
5678
5686
|
state,
|
|
@@ -5721,7 +5729,7 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
5721
5729
|
invalidateWorkerCopies(state);
|
|
5722
5730
|
return beginCheckpointRestore(state, shape);
|
|
5723
5731
|
}),
|
|
5724
|
-
openColdField:
|
|
5732
|
+
openColdField: openColdFieldTracked,
|
|
5725
5733
|
startShuffledRebuildWhenDue: () => {
|
|
5726
5734
|
if (state.cold === null) startShuffledRebuild(state);
|
|
5727
5735
|
},
|
|
@@ -7979,10 +7979,11 @@ async function openListedFile(store, ref, what, allowsCompression) {
|
|
|
7979
7979
|
requireListedChecksum(what, ref.key, header2.checksum, ref.checksum);
|
|
7980
7980
|
return { payload, payloadLength: header2.payloadLength };
|
|
7981
7981
|
}
|
|
7982
|
-
async function readGraphParts(store, ref) {
|
|
7982
|
+
async function readGraphParts(store, ref, stillWanted = () => true) {
|
|
7983
7983
|
if (ref.graphParts.length === 0) return null;
|
|
7984
7984
|
const parts = [];
|
|
7985
7985
|
for (const part of ref.graphParts) {
|
|
7986
|
+
if (!stillWanted()) return null;
|
|
7986
7987
|
const { payload } = await openListedFile(store, part, "graph part", true);
|
|
7987
7988
|
const decoded = decodeVectorGraphPartPayload(decode(payload));
|
|
7988
7989
|
if (decoded.fieldName !== ref.fieldPath) {
|
|
@@ -8045,7 +8046,7 @@ async function loadFieldOnDemand(store, ref, vectorIndex, resolvePartition) {
|
|
|
8045
8046
|
vectorIndex.openColdField(field, async (beginRestore, stillWanted, loadingWanted) => {
|
|
8046
8047
|
await waitBeforeColdLoad(loadingWanted);
|
|
8047
8048
|
if (!stillWanted()) return;
|
|
8048
|
-
const graph = await readGraphParts(store, ref);
|
|
8049
|
+
const graph = await readGraphParts(store, ref, stillWanted);
|
|
8049
8050
|
if (!stillWanted()) return;
|
|
8050
8051
|
const restore = beginRestore({ liveVectors: liveVectorsOf(ref), holdsGraph: true, graph });
|
|
8051
8052
|
await loadFilesByParts(files, restore, ref.fieldPath, vectorIndex.dimension, stillWanted);
|
|
@@ -12851,8 +12852,8 @@ async function commitToStorage(indexName, restored, previous, deps) {
|
|
|
12851
12852
|
if (relocate === null) return;
|
|
12852
12853
|
for (const vectorIndex of vectorIndexes) vectorIndex.relocateVectorFiles(relocate);
|
|
12853
12854
|
}
|
|
12854
|
-
function activate(indexName, restored, entry, deps) {
|
|
12855
|
-
deps.executor.installDetachedIndex(restored.detached);
|
|
12855
|
+
async function activate(indexName, restored, entry, deps) {
|
|
12856
|
+
const disposed = deps.executor.installDetachedIndex(restored.detached);
|
|
12856
12857
|
deps.indexRegistry.set(indexName, entry);
|
|
12857
12858
|
entry.storedSizes?.recordSavedBytes(entry.savedBytes);
|
|
12858
12859
|
restored.detached.attach();
|
|
@@ -12868,6 +12869,7 @@ function activate(indexName, restored, entry, deps) {
|
|
|
12868
12869
|
}
|
|
12869
12870
|
if (restored.staging !== null) deps.durability?.manager.adoptRestoredCheckpoint?.(indexName, restored.checkpoint);
|
|
12870
12871
|
deps.forgetWatermark(indexName);
|
|
12872
|
+
await disposed;
|
|
12871
12873
|
}
|
|
12872
12874
|
async function replaceExisting(indexName, restored, entry, deps) {
|
|
12873
12875
|
const release = { reloads: false, held: [], settled: Promise.resolve(), timedOut: false };
|
|
@@ -12881,7 +12883,7 @@ async function replaceExisting(indexName, restored, entry, deps) {
|
|
|
12881
12883
|
await withinLimit(indexName, release, holdVectorCopies(vectorIndexes, release), deps);
|
|
12882
12884
|
for (const vectorIndex of vectorIndexes) await vectorIndex.releaseVectorFiles();
|
|
12883
12885
|
await commitToStorage(indexName, restored, previous, deps);
|
|
12884
|
-
if (previous === void 0) activate(indexName, restored, entry, deps);
|
|
12886
|
+
if (previous === void 0) await activate(indexName, restored, entry, deps);
|
|
12885
12887
|
else await previous.publication.write(() => activate(indexName, restored, entry, deps));
|
|
12886
12888
|
await deps.querySuggestions?.afterActivate(entry);
|
|
12887
12889
|
});
|
|
@@ -12892,13 +12894,14 @@ async function replaceExisting(indexName, restored, entry, deps) {
|
|
|
12892
12894
|
}
|
|
12893
12895
|
async function createFresh(indexName, restored, entry, deps) {
|
|
12894
12896
|
deps.copies.desyncIndex(indexName);
|
|
12895
|
-
deps.executor.installDetachedIndex(restored.detached);
|
|
12897
|
+
const disposed = deps.executor.installDetachedIndex(restored.detached);
|
|
12896
12898
|
deps.indexRegistry.set(indexName, entry);
|
|
12897
12899
|
entry.storedSizes?.recordSavedBytes(entry.savedBytes);
|
|
12900
|
+
await disposed;
|
|
12898
12901
|
try {
|
|
12899
12902
|
await deps.indexState.registerReplacing(indexName, async () => {
|
|
12900
12903
|
await commitToStorage(indexName, restored, void 0, deps);
|
|
12901
|
-
activate(indexName, restored, entry, deps);
|
|
12904
|
+
await activate(indexName, restored, entry, deps);
|
|
12902
12905
|
await deps.querySuggestions?.afterActivate(entry);
|
|
12903
12906
|
});
|
|
12904
12907
|
} catch (error) {
|
|
@@ -12932,8 +12935,8 @@ async function installRestoredIndex(indexName, restored, deps, history = null) {
|
|
|
12932
12935
|
if (replaced !== void 0) await replaceExisting(indexName, restored, entry, deps);
|
|
12933
12936
|
else await createFresh(indexName, restored, entry, deps);
|
|
12934
12937
|
} catch (error) {
|
|
12935
|
-
if (deps.executor.getManager(indexName) === restored.detached.manager) deps.executor.dropIndex(indexName);
|
|
12936
|
-
else deps.executor.discardDetachedIndex(restored.detached);
|
|
12938
|
+
if (deps.executor.getManager(indexName) === restored.detached.manager) await deps.executor.dropIndex(indexName);
|
|
12939
|
+
else await deps.executor.discardDetachedIndex(restored.detached);
|
|
12937
12940
|
throw error;
|
|
12938
12941
|
}
|
|
12939
12942
|
await restored.staging?.removeRetired().catch(() => void 0);
|
|
@@ -13052,7 +13055,7 @@ async function loadStagedIndex(indexName, staged, staging, store, deps) {
|
|
|
13052
13055
|
true
|
|
13053
13056
|
);
|
|
13054
13057
|
} catch (error) {
|
|
13055
|
-
deps.executor.discardDetachedIndex(detached);
|
|
13058
|
+
await deps.executor.discardDetachedIndex(detached);
|
|
13056
13059
|
throw error;
|
|
13057
13060
|
}
|
|
13058
13061
|
return { prepared, detached, staging, checkpoint: manifest.checkpoint, saved: savedBytesOfManifest(manifest) };
|
|
@@ -13284,10 +13287,10 @@ async function buildRestoredIndex(indexName, envelope, prepared, staging, deps)
|
|
|
13284
13287
|
if (staging === null) return { prepared, detached: built, staging: null, checkpoint: [], saved: null };
|
|
13285
13288
|
manifest = await stageBuiltIndex(indexName, prepared, built, staging, deps);
|
|
13286
13289
|
} catch (err) {
|
|
13287
|
-
deps.executor.discardDetachedIndex(built);
|
|
13290
|
+
await deps.executor.discardDetachedIndex(built);
|
|
13288
13291
|
throw err;
|
|
13289
13292
|
}
|
|
13290
|
-
deps.executor.discardDetachedIndex(built);
|
|
13293
|
+
await deps.executor.discardDetachedIndex(built);
|
|
13291
13294
|
return loadStagedIndex(indexName, { prepared, manifest }, staging, staging.store, deps);
|
|
13292
13295
|
}
|
|
13293
13296
|
async function restoreEarlierSnapshot(indexName, data, deps) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-M2Z5WVWW.mjs';
|
|
2
2
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import { storedStateOf } from './chunk-
|
|
4
|
-
import { getLanguage, generateId, decodeSynonymRules } from './chunk-
|
|
3
|
+
import { storedStateOf } from './chunk-KOA6T2IC.mjs';
|
|
4
|
+
import { getLanguage, generateId, decodeSynonymRules } from './chunk-HSA3H3VW.mjs';
|
|
5
5
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
6
6
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
7
7
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-3ECIRFS5.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION } from './chunk-
|
|
1
|
+
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION } from './chunk-TSE2VWPX.mjs';
|
|
2
2
|
import { encode } from './chunk-S5QMWECL.mjs';
|
|
3
3
|
import { createFixedBuffer, createVectorFileReader } from './chunk-KBU3ZFJN.mjs';
|
|
4
|
-
import { crc32, packChecksummedEnvelope, HEADER_SIZE } from './chunk-
|
|
4
|
+
import { crc32, packChecksummedEnvelope, HEADER_SIZE } from './chunk-KOA6T2IC.mjs';
|
|
5
5
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
6
6
|
import { nativeSearchCoreIsEnabled, loadNativeCore } from './chunk-ASZLNVWW.mjs';
|
|
7
7
|
import { ErrorCodes, NarsilError } from './chunk-ZKOQR7EA.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { encode, Merger } from './chunk-
|
|
2
|
-
import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-
|
|
1
|
+
import { encode, Merger } from './chunk-FGOGT273.mjs';
|
|
2
|
+
import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-6MC6BCXK.mjs';
|
|
3
3
|
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
4
|
-
import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-
|
|
5
|
-
import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-
|
|
4
|
+
import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-KOA6T2IC.mjs';
|
|
5
|
+
import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-HSA3H3VW.mjs';
|
|
6
6
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
7
7
|
import { spawnNodeWorker, resolveWorkerEntry } from './chunk-RORNUNXW.mjs';
|
|
8
8
|
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-
|
|
1
|
+
import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-HSA3H3VW.mjs';
|
|
2
2
|
|
|
3
3
|
// src/partitioning/constants.ts
|
|
4
4
|
var REBALANCE_CHUNK_SIZE = 1e3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-
|
|
2
|
-
import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-
|
|
1
|
+
import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-KOA6T2IC.mjs';
|
|
2
|
+
import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-HSA3H3VW.mjs';
|
|
3
3
|
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/query-suggestions/engine-hooks.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CHANGES_SUBPROTOCOL, SYNC_SUBPROTOCOL, encodeJson, SYNC_CLOSE_SERVER_ERROR, encodeScore } from './chunk-F6F4G322.mjs';
|
|
2
|
-
import { answerRefusalOf } from './chunk-
|
|
3
|
-
import { archiveRange, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES } from './chunk-
|
|
4
|
-
import { readRecentMemoryFigures, readMemoryFigures, DEFAULT_RERANK_WINDOW } from './chunk-
|
|
2
|
+
import { answerRefusalOf } from './chunk-JXINPXRS.mjs';
|
|
3
|
+
import { archiveRange, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES } from './chunk-Z6SIJH5O.mjs';
|
|
4
|
+
import { readRecentMemoryFigures, readMemoryFigures, DEFAULT_RERANK_WINDOW } from './chunk-HSA3H3VW.mjs';
|
|
5
5
|
import { collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, reservedHeapBytes, admitHeapBytes } from './chunk-AOYQTX6W.mjs';
|
|
6
6
|
import { MAX_FILTER_DEPTH } from './chunk-IL5DRCNU.mjs';
|
|
7
7
|
import { bindSignalStop } from './chunk-RORNUNXW.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PAGED_SEGMENT_ENVELOPE_VERSION, loadFailed, checkEverySectionPage, openPagedFile, sectionNamed, createSectionReader, closePagedFile, readWholeSectionChecked, readCacheOfThisThread, createReadCache, MERGE_READ_CACHE_BYTES, encodePagedSegmentHead, SECTION_ALIGNMENT_BYTES, SEGMENT_PAGE_BYTES, FILE_ASSEMBLY_CHUNK_BYTES, readListedFile, requireListedChecksum, encodeSegmentManifest, requireNativePage, ID_SAMPLE_INTERVAL, SMALLEST_BLOCK_POSTINGS, readFileRange, PAYLOAD_PREFIX_BYTES, decodePagedSegmentHead, BLOCK_SUMMARY_BYTES, DOCUMENT_BLOCK_BYTES, MAX_DOCUMENT_BLOCK_RAW_BYTES, resumePagedFile, suspendPagedFile, cachedFileBytes, LIST_VIEWS_HELD_PER_SEGMENT, WRITER_YIELD_INTERVAL_TOKENS, DOCUMENT_BLOCK_MIN_RAW_BYTES, CACHED_POSITIONS, POSITION_WIDTH_BYTES, CACHED_LIST, POSTING_WIDTH_BYTES, readFileRangeLater, CACHED_DOCUMENT_BLOCK, failNativePage, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, POSTING_WRITE_ROWS, POSTING_WRITE_POSITIONS, SECTION_WRITE_BUFFER_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-
|
|
1
|
+
import { PAGED_SEGMENT_ENVELOPE_VERSION, loadFailed, checkEverySectionPage, openPagedFile, sectionNamed, createSectionReader, closePagedFile, readWholeSectionChecked, readCacheOfThisThread, createReadCache, MERGE_READ_CACHE_BYTES, encodePagedSegmentHead, SECTION_ALIGNMENT_BYTES, SEGMENT_PAGE_BYTES, FILE_ASSEMBLY_CHUNK_BYTES, readListedFile, requireListedChecksum, encodeSegmentManifest, requireNativePage, ID_SAMPLE_INTERVAL, SMALLEST_BLOCK_POSTINGS, readFileRange, PAYLOAD_PREFIX_BYTES, decodePagedSegmentHead, BLOCK_SUMMARY_BYTES, DOCUMENT_BLOCK_BYTES, MAX_DOCUMENT_BLOCK_RAW_BYTES, resumePagedFile, suspendPagedFile, cachedFileBytes, LIST_VIEWS_HELD_PER_SEGMENT, WRITER_YIELD_INTERVAL_TOKENS, DOCUMENT_BLOCK_MIN_RAW_BYTES, CACHED_POSITIONS, POSITION_WIDTH_BYTES, CACHED_LIST, POSTING_WIDTH_BYTES, readFileRangeLater, CACHED_DOCUMENT_BLOCK, failNativePage, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, POSTING_WRITE_ROWS, POSTING_WRITE_POSITIONS, SECTION_WRITE_BUFFER_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-3N5GUXBI.mjs';
|
|
2
2
|
import { ReplicationMessageTypes } from './chunk-5FLRXF73.mjs';
|
|
3
3
|
import { WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
|
|
4
|
-
import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION, segmentKey } from './chunk-
|
|
4
|
+
import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION, segmentKey } from './chunk-TSE2VWPX.mjs';
|
|
5
5
|
import { DEFAULT_REWRITE_BYTES_PER_CHECKPOINT, DEFAULT_COMPACTION_THRESHOLD, SEGMENT_FILE_FRAMING_SLACK_BYTES, REWRITE_ABOVE_REMOVED_DOCUMENT_SHARE, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_TOKEN_TABLE_SHARE_OF_FILE } from './chunk-MSIN4NM3.mjs';
|
|
6
6
|
import { encode } from './chunk-S5QMWECL.mjs';
|
|
7
7
|
import { restoreVectorFields } from './chunk-R2PJKSNL.mjs';
|
|
8
|
-
import { requireWithinFileLimit, HEADER_SIZE, crc32Init, crc32Update, crc32Final, engineVersionParts, writeHeader, crc32, openChecksummedEnvelope, readHeader, packChecksummedEnvelope } from './chunk-
|
|
9
|
-
import { decodeStoredDocument, generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, buildPartialWordTableFrom, mergeFieldIndexes, isCompositePartition, reconstructSchemaFromMetadata, decodeSurfaceTable, mergeDocFrequencies, TermLookup, createFrozenRemovals, selectionKeeps, fieldIndexRemapOf, mergeKeywordSources, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, createSharedFrozenSegment, shareSegmentArrays, getLanguage, emptyPendingRegions, mergePostings2, scanPostingBlocks, holdsADiscardedField, SegmentRefusal, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayloads, resolvePartitionInsertOptions, endOfValue, segmentArraysOf, mergeSegmentContents, decodeMapWithoutFields, prepareDocumentVectors, resolveIndexAnalysis } from './chunk-
|
|
8
|
+
import { requireWithinFileLimit, HEADER_SIZE, crc32Init, crc32Update, crc32Final, engineVersionParts, writeHeader, crc32, openChecksummedEnvelope, readHeader, packChecksummedEnvelope } from './chunk-KOA6T2IC.mjs';
|
|
9
|
+
import { decodeStoredDocument, generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, buildPartialWordTableFrom, mergeFieldIndexes, isCompositePartition, reconstructSchemaFromMetadata, decodeSurfaceTable, mergeDocFrequencies, TermLookup, createFrozenRemovals, selectionKeeps, fieldIndexRemapOf, mergeKeywordSources, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, createSharedFrozenSegment, shareSegmentArrays, getLanguage, emptyPendingRegions, mergePostings2, scanPostingBlocks, holdsADiscardedField, SegmentRefusal, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayloads, resolvePartitionInsertOptions, endOfValue, segmentArraysOf, mergeSegmentContents, decodeMapWithoutFields, prepareDocumentVectors, resolveIndexAnalysis } from './chunk-HSA3H3VW.mjs';
|
|
10
10
|
import { encodeDocument } from './chunk-2CKDCC65.mjs';
|
|
11
11
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
12
12
|
import { extractVectorFieldsFromSchema, VECTOR_PATTERN, requireValidFieldTypes, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-7P5YWDRQ.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { openCountsFile } from './chunk-
|
|
2
|
-
import { SCRAMBLED_ID_BYTES } from './chunk-
|
|
1
|
+
import { openCountsFile } from './chunk-6MC6BCXK.mjs';
|
|
2
|
+
import { SCRAMBLED_ID_BYTES } from './chunk-KOA6T2IC.mjs';
|
|
3
3
|
export { encode } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
function bindSuggestionsHost(_host, _msgpack, _suggestionStore) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isValidInteger, isRecord } from './chunk-
|
|
1
|
+
import { isValidInteger, isRecord } from './chunk-2HVQYOOD.mjs';
|
|
2
2
|
import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-
|
|
3
|
+
import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-KOA6T2IC.mjs';
|
|
4
4
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
5
5
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
6
6
|
import { joinChunks } from './chunk-GR5GMFJJ.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, emitSyncChange } from './chunk-
|
|
1
|
+
import { withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, emitSyncChange } from './chunk-HSA3H3VW.mjs';
|
|
2
2
|
import { ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/engine/bm25-update.ts
|