@delali/narsil 0.3.1-next.185 → 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/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
- package/dist/browser/{chunk-CPSHS46N.mjs → chunk-UQG4HUGQ.mjs} +82 -50
- package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
- package/dist/browser/{module-XVLHJ7T7.mjs → module-ZZTNG5JZ.mjs} +26 -3
- package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
- package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-N3JMQ6CF.mjs} +14569 -13747
- package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
- package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
- package/dist/{chunk-CODGHJVW.mjs → chunk-2HVQYOOD.mjs} +40 -12
- package/dist/{chunk-M5I64AQW.mjs → chunk-3N5GUXBI.mjs} +33 -33
- package/dist/{chunk-DU23J5JG.mjs → chunk-5CIHQIA4.mjs} +6 -6
- package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-62X472AC.mjs} +1 -1
- package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
- package/dist/{chunk-G3XRHAJA.mjs → chunk-6MC6BCXK.mjs} +3 -3
- package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
- package/dist/{chunk-MHBG33R5.mjs → chunk-7X4IIREW.mjs} +76 -46
- package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
- package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
- package/dist/{chunk-LR6JJVML.mjs → chunk-D2EJUM4A.mjs} +764 -699
- package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
- package/dist/{chunk-2YWWHMVC.mjs → chunk-FGOGT273.mjs} +2 -2
- package/dist/{chunk-5BUEBIXR.mjs → chunk-GLXLSPLO.mjs} +18 -5
- package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
- package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
- package/dist/{chunk-BVZWWMOU.mjs → chunk-HHYQMGPW.mjs} +2 -2
- package/dist/{chunk-SL53DHVE.mjs → chunk-HSA3H3VW.mjs} +121 -68
- package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
- package/dist/{chunk-JDG6CCXM.mjs → chunk-JENWA4WX.mjs} +2 -2
- package/dist/{chunk-2GONI5HL.mjs → chunk-JXINPXRS.mjs} +5 -4
- package/dist/chunk-K5GNK5GE.mjs +602 -0
- package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
- package/dist/{chunk-EDEE7ETQ.mjs → chunk-KOA6T2IC.mjs} +3 -3
- package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
- package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
- package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/{chunk-VYSWVQCE.mjs → chunk-PAPQGC6I.mjs} +2 -2
- package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
- package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
- package/dist/{chunk-FBQYC5OX.mjs → chunk-SB5HCIIO.mjs} +16 -13
- package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
- package/dist/{chunk-O337MDRJ.mjs → chunk-SHES4VP5.mjs} +38 -13
- package/dist/{chunk-H4QYQ5DE.mjs → chunk-SIIDIGKI.mjs} +2 -2
- package/dist/{chunk-A3OAFUZI.mjs → chunk-SM2SYVIX.mjs} +2 -2
- package/dist/{chunk-II6XF6M4.mjs → chunk-SMLUZGSI.mjs} +9 -8
- package/dist/{chunk-2KCCQK4R.mjs → chunk-TSE2VWPX.mjs} +2 -2
- package/dist/{chunk-WSIU6YXQ.mjs → chunk-YPEJ6ODL.mjs} +1732 -743
- package/dist/{chunk-7WXGUTWK.mjs → chunk-Z6SIJH5O.mjs} +17 -6
- package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
- package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
- package/dist/{chunk-FCQMZDRI.mjs → chunk-ZVZYJIIP.mjs} +3 -3
- package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -1265
- package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
- package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
- package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
- package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-WSZALYCV.mjs} +8 -8
- package/dist/distribution/coordinator/etcd.d.ts +1 -1
- package/dist/distribution/coordinator/etcd.mjs +35 -15
- package/dist/distribution/coordinator/in-memory.d.ts +1 -1
- package/dist/distribution/coordinator/in-memory.mjs +16 -6
- package/dist/distribution/transport/grpc.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +70 -9
- package/dist/distribution.mjs +1695 -680
- package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
- package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
- package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.react-native.mjs +9 -9
- package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-N2DNPEA3.mjs} +21 -21
- package/dist/{module-Z3CL4GJ4.mjs → module-UQFIJQMG.mjs} +33 -13
- package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
- package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
- package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-CGDBJBHQ.mjs} +31 -18
- package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-UK44CVXG.mjs} +20 -20
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +8 -8
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
- package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
- package/dist/{query-actions-7EOKT3WD.mjs → query-actions-7BL3YZDW.mjs} +8 -8
- package/dist/query-suggestions/merge-worker.mjs +11 -11
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +1 -1
- package/dist/query-suggestions.mjs +9 -9
- package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
- package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-63DZ26X5.mjs} +277 -75
- package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-BNFGA7TY.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
- package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-IP3QLETQ.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-LOKGE4OQ.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
- package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-UYAZLGEM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-XHYOQ4K4.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
- package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
- package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
- package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
- package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
- package/dist/react-native/chunks/{module-COLNJNML.mjs → module-QRCYB7QV.mjs} +32 -9
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
- package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-GC6JWMAF.mjs} +31 -18
- package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
- package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
- package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-2ACONS4W.mjs} +12 -12
- package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-SSIWXVUG.mjs} +10 -10
- package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-I2WDFE6O.mjs} +11 -11
- package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-YXXMG4VR.mjs} +14727 -13915
- package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-FS7A4PZA.mjs} +11 -11
- package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-PSFCT5EX.mjs} +11 -11
- package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-QRMISMEL.mjs} +10 -10
- package/dist/react-native/partial-words.mjs +9 -9
- package/dist/react-native/pattern.mjs +5 -5
- package/dist/react-native/query-suggestions.mjs +9 -9
- package/dist/react-native/sync.mjs +433 -51
- package/dist/react-native/synonyms.mjs +9 -9
- package/dist/react.d.ts +8 -8
- package/dist/react.mjs +7 -0
- package/dist/{rerank-KTV5L7MZ.mjs → rerank-4GFC26FD.mjs} +8 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
- package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-E4EIUYVV.mjs} +11 -11
- package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-MP6DILVE.mjs} +9 -9
- package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-ED2NMUC5.mjs} +9 -9
- package/dist/server.d.ts +13 -9
- package/dist/server.mjs +875 -348
- package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-HQFO37W7.mjs} +5234 -5835
- package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-PL2G7RM5.mjs} +10 -10
- package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-I3MEHACP.mjs} +12 -12
- package/dist/sync/filesystem.d.ts +2 -2
- package/dist/sync/filesystem.mjs +16 -16
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +2 -2
- package/dist/sync/indexeddb.mjs +3 -3
- package/dist/sync.browser.mjs +35 -1108
- package/dist/sync.d.ts +3 -3
- package/dist/sync.mjs +430 -51
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +8 -8
- package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
- package/dist/thread-LTFI3RK5.mjs +31 -0
- package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-P7YWXEP5.mjs} +11 -11
- package/dist/workers/entry.mjs +14 -14
- package/openapi.json +144 -0
- package/package.json +5 -7
- package/dist/chunk-URVH6BLO.mjs +0 -217
- package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
- package/dist/thread-NQRNW3IH.mjs +0 -31
- /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { reservedHeapBytes, reserveHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal, admittedHeapBytes } from './chunk-
|
|
2
|
-
import { fnv1aUtf16, changeIndexOutsideExternalWaits, turnsAreBudgeted, turnIsSpent, yieldTurn, createDocIdMap, detectRuntime, fnv1a, indexChangeOutsideExternalWaits, splitWorkerBudget, resolveWorkerCount, yieldBackgroundTurn, backgroundTurnIsSpent, FNV_OFFSET_BASIS, DEFAULT_REQUEST_TIMEOUT_MS, countWrite, HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, answerFromOneState, signalOfSearch, requirePinnedState,
|
|
1
|
+
import { reservedHeapBytes, reserveHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal, admittedHeapBytes } from './chunk-AN4HKLB4.mjs';
|
|
2
|
+
import { fnv1aUtf16, changeIndexOutsideExternalWaits, turnsAreBudgeted, turnIsSpent, yieldTurn, createDocIdMap, detectRuntime, fnv1a, indexChangeOutsideExternalWaits, stopOfSignal, splitWorkerBudget, resolveWorkerCount, sharedStopOfSignal, requireSearchActive, yieldBackgroundTurn, backgroundTurnIsSpent, FNV_OFFSET_BASIS, DEFAULT_REQUEST_TIMEOUT_MS, countWrite, HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, answerFromOneState, signalOfSearch, requirePinnedState, fnv1aContinue, fnv1aContinueTaggedNumbers, FNV_PRIME, collectAndReturnPages, shardEntryRangeOf, threadSlotOfWorker, resolveRequestThreadCount, SHUTDOWN_TIMEOUT_MS, DEFAULT_BACKPRESSURE_LIMIT, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, threadSlotGone, spawnNodeWorker, resolveWorkerEntry, noteThreadSlotLive, noteThreadSlotGone, bindSearchSignal, adoptSharedTurns, WORKER_YOUNG_GENERATION_MB, WASM_PAGE_BYTES, VECTOR_STORE_INITIAL_CAPACITY, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_INSERT_TIMEOUT_MS, VECTOR_BLOCK_MAX_BYTES, VECTOR_BLOCK_INITIAL_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, NATIVE_THREAD_SEARCH_SLOTS, NATIVE_THREAD_SCAN_CHUNK_ORDINALS, NATIVE_ATTACH_RETRY_MS, MAX_WASM_PAGES, MAX_VECTOR_ORDINALS, MAX_RENUMBERED_SEARCH_ATTEMPTS, MAX_DOC_ID_TABLE_BYTES, LOCK_WAIT_SLICE_MS, LOCK_SPIN_ITERATIONS, GRAPH_LOCK_WAIT_SLICE_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, GRAPH_BUILD_DISPATCH_CHUNK, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, DISK_STORAGE_BLOCK_BYTES, waitOutsideCountedWrite, nodeThreadId } from './chunk-G434H5WG.mjs';
|
|
3
3
|
import { MIN_DOCUMENTS_FOR_SEGMENTS, MAX_PARTITIONS, MAX_INDEX_CONFIGURATION_BYTES, BATCH_CHUNK_SIZE, BM25_DISPLAYED_NAME_LENGTH, MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, MAX_CALLS_ACROSS_INDEX_CHANGES, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, MAX_SWEEP_INTERVAL_MS, HEAP_PRESSURE_WARNING_FRACTION, MIN_SWEEP_INTERVAL_MS, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_LIMIT, DEFAULT_OFFSET, RESULT_WINDOW, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, DEFAULT_PAGE_SIZE, CURSOR_BINDING_BUFFER_BYTES, PREFIX_MAX_EXPANSIONS, HEAP_PRESSURE_REARM_FRACTION, MAX_TOLERANCE, MAX_PREFIX_LENGTH, MIN_RANK_CONSTANT, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, FUSION_TIE_INSERTION_LIMIT, DEFAULT_RANK_CONSTANT, DEFAULT_LINEAR_ALPHA, STATISTICS_BROADCAST_INTERVAL_MS, MAX_IMPORT_REFUSALS_REPORTED, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, FOREIGN_STATS_TTL_MS, EXPORT_CHUNK_BYTES, DEFAULT_MAX_PARTITIONS, ANALYSIS_HOLD_APPLY_INTERVAL_MS, ANALYSIS_CHANGE_MEMBERS, MIN_HYBRID_DEPTH, MAX_SUGGEST_SCATTER_LIMIT, MAX_SUGGEST_LIMIT, MAX_QUERY_PHRASES, MAX_PHRASE_WORDS, MAX_HYBRID_DEPTH, HYBRID_RESCORE_WINDOW, DEFAULT_SUGGEST_LIMIT, DEFAULT_MAX_PER_GROUP } from './chunk-LX62Y4B5.mjs';
|
|
4
|
-
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, bitsetHas, bitsetClear, storedText, cachedStoredFields, storedValuesOf, bitsetSet, discardStoredValues, createBitSet, installStoredFields, storedValueBytes,
|
|
5
|
-
import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback, NATIVE_NEEDS_ROOM, NATIVE_OK } from './chunk-
|
|
6
|
-
import { reactNativeHost } from './chunk-
|
|
7
|
-
import { headerAt, MAP_TAGS, decode, encodeDocument, Decoder } from './chunk-
|
|
8
|
-
import { parsedTypeOf, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, schemaFieldsOf, getNestedValue, tokenizeOptions, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT,
|
|
4
|
+
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, DEFAULT_PATTERN_WORK_CAP, bitsetHas, bitsetClear, storedText, cachedStoredFields, storedValuesOf, bitsetSet, discardStoredValues, createBitSet, installStoredFields, storedValueBytes, bitsetIsEmpty, prepareStoredValues, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, fuzzyPrefixOf, boundedLevenshtein, checkedSize, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, buildStoredValues, FILTER_OPERAND_COPY_DEPTH, fuzzyTermMatches, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES, bitsetIterator, GrowableUint32, bitsetFromSet } from './chunk-HTBY4GON.mjs';
|
|
5
|
+
import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback, NATIVE_NEEDS_ROOM, NATIVE_OK } from './chunk-UYKIV2KT.mjs';
|
|
6
|
+
import { reactNativeHost } from './chunk-CW2ZFXSE.mjs';
|
|
7
|
+
import { headerAt, MAP_TAGS, decode, encodeDocument, Decoder } from './chunk-UO44MA5M.mjs';
|
|
8
|
+
import { parsedTypeOf, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, schemaFieldsOf, getNestedValue, tokenizeOptions, flattenSchema, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, vectorDimensionOf, isSingleStringFieldType, messagePackUpperBoundBytes, extractVectorFieldsFromSchema, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, loadMessagePack, validateRequiredFields, requireDocumentWithinSizeLimit, raiseEarlierReleaseGraphSetting, PROTOTYPE_POLLUTION_KEYS, isPlainObject, isWordIndexedFieldType, loadedMessagePack, validateDocument, validateDocumentStrict, textFieldsChanged, MAX_NESTING_DEPTH, getFlatSchema, getOrCreateFieldNameIndex, isWordIndexedBase, isStringValuedBase, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, MAX_DOCUMENT_NESTING_DEPTH, 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 } from './chunk-MRH36RN3.mjs';
|
|
9
9
|
import { withUnpairedSurrogatesReplaced, compareCodePoints, holdsUnpairedSurrogate, defaultSortMode, toComparableSortValue, exceedsCodePoints, SORT_VALUE_MAX_CODE_POINTS, sortModeOf, PLACEMENT_ROOM_REQUESTS, NEAREST_LINK_FALLBACK_HOSTS, MIN_M, MAX_M, MAX_LAYER_CAP, 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, truncateSortString, SORT_MODES, isSortMode, codePointCount } from './chunk-HRDMIQ63.mjs';
|
|
10
10
|
import { MAX_DOCUMENT_ENCODING_DEPTH, MAX_FILE_BYTES, VALID_HNSW_METRICS, NATIVE_CRC32_MIN_BYTES, CHECKSUM_YIELD_CHUNK_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER } from './chunk-VUJCSQG5.mjs';
|
|
11
|
-
import { NarsilError, ErrorCodes, createNarsilError, isNarsilError } from './chunk-
|
|
11
|
+
import { NarsilError, ErrorCodes, createNarsilError, isNarsilError } from './chunk-43R4GCM7.mjs';
|
|
12
12
|
|
|
13
13
|
// src/analysis/registry.ts
|
|
14
14
|
var tokenizers = /* @__PURE__ */ new Map();
|
|
@@ -4535,7 +4535,7 @@ function requireLoadedPhraseCode() {
|
|
|
4535
4535
|
}
|
|
4536
4536
|
function loadPhraseCode() {
|
|
4537
4537
|
if (loading === null) {
|
|
4538
|
-
loading = import('./phrase-module-
|
|
4538
|
+
loading = import('./phrase-module-IGYBK7XH.mjs').then(
|
|
4539
4539
|
(code7) => {
|
|
4540
4540
|
code7.bindPhraseHost(optionalCodeHost());
|
|
4541
4541
|
loaded = code7;
|
|
@@ -8679,7 +8679,7 @@ function resolvePartitionInsertOptions(config, analysis, options) {
|
|
|
8679
8679
|
|
|
8680
8680
|
// src/core/segment-codec-code.ts
|
|
8681
8681
|
var segmentCodec = codeLoader(async () => {
|
|
8682
|
-
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-
|
|
8682
|
+
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-SSIWXVUG.mjs')]);
|
|
8683
8683
|
code7.bindSegmentCodecHost(optionalCodeHost(), msgpack);
|
|
8684
8684
|
return code7;
|
|
8685
8685
|
}, "segment codec");
|
|
@@ -8690,7 +8690,7 @@ var segmentMerge = codeLoader(async () => {
|
|
|
8690
8690
|
const [msgpack, codec, code7] = await Promise.all([
|
|
8691
8691
|
loadMessagePack(),
|
|
8692
8692
|
loadSegmentCodec(),
|
|
8693
|
-
import('./segment-merge-leaf-
|
|
8693
|
+
import('./segment-merge-leaf-I2WDFE6O.mjs')
|
|
8694
8694
|
]);
|
|
8695
8695
|
code7.bindSegmentMergeHost(optionalCodeHost(), msgpack, codec);
|
|
8696
8696
|
return code7;
|
|
@@ -8699,7 +8699,7 @@ var loadSegmentMerge = segmentMerge.load;
|
|
|
8699
8699
|
|
|
8700
8700
|
// src/query-suggestions/store-code.ts
|
|
8701
8701
|
var suggestionStore = codeLoader(async () => {
|
|
8702
|
-
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-
|
|
8702
|
+
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-FS7A4PZA.mjs')]);
|
|
8703
8703
|
code7.bindSuggestionStoreHost(optionalCodeHost(), msgpack);
|
|
8704
8704
|
return code7;
|
|
8705
8705
|
}, "query suggestions store");
|
|
@@ -8758,7 +8758,7 @@ function markSimdUnavailable() {
|
|
|
8758
8758
|
|
|
8759
8759
|
// src/workers/vector-core-code.ts
|
|
8760
8760
|
var vectorCore = codeLoader(
|
|
8761
|
-
() => import('./core-leaf-
|
|
8761
|
+
() => import('./core-leaf-5PVST5PR.mjs').then((code7) => {
|
|
8762
8762
|
code7.bindVectorCoreHost(optionalCodeHost());
|
|
8763
8763
|
if (!code7.simdModuleLoaded()) markSimdUnavailable();
|
|
8764
8764
|
return code7;
|
|
@@ -8780,7 +8780,7 @@ var storageCode = codeLoader(async () => {
|
|
|
8780
8780
|
loadSegmentMerge(),
|
|
8781
8781
|
loadSuggestionStore(),
|
|
8782
8782
|
loadVectorCore(),
|
|
8783
|
-
import('./storage-leaf-
|
|
8783
|
+
import('./storage-leaf-YXXMG4VR.mjs')
|
|
8784
8784
|
]);
|
|
8785
8785
|
code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
|
|
8786
8786
|
return code7;
|
|
@@ -19943,7 +19943,7 @@ function hasLanguage(name) {
|
|
|
19943
19943
|
|
|
19944
19944
|
// src/narsil/restore-queue-code.ts
|
|
19945
19945
|
var restoreQueue = codeLoader(async () => {
|
|
19946
|
-
const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-
|
|
19946
|
+
const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-2ACONS4W.mjs')]);
|
|
19947
19947
|
code7.bindRestoreQueueHost(optionalCodeHost(), suggestionStore2);
|
|
19948
19948
|
return code7;
|
|
19949
19949
|
}, "restore");
|
|
@@ -20165,7 +20165,7 @@ function storedBM25Params(params) {
|
|
|
20165
20165
|
|
|
20166
20166
|
// src/workers/vector-code.ts
|
|
20167
20167
|
var vectorCode = codeLoader(async () => {
|
|
20168
|
-
const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-
|
|
20168
|
+
const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-QRCYB7QV.mjs')]);
|
|
20169
20169
|
code7.bindVectorHost(optionalCodeHost(), vectorCore2);
|
|
20170
20170
|
return code7;
|
|
20171
20171
|
}, "vector");
|
|
@@ -20405,6 +20405,7 @@ async function createEngineIndex(core2, config, name, requestedConfig, creation
|
|
|
20405
20405
|
pendingAnalysis: null,
|
|
20406
20406
|
durableAnalysis: null,
|
|
20407
20407
|
sync: null,
|
|
20408
|
+
changes: null,
|
|
20408
20409
|
querySuggestions: creation.querySuggestions ?? null
|
|
20409
20410
|
});
|
|
20410
20411
|
await core2.indexState.registerOpen(name);
|
|
@@ -20434,11 +20435,12 @@ async function dropEngineIndex(core2, name) {
|
|
|
20434
20435
|
throw error;
|
|
20435
20436
|
}
|
|
20436
20437
|
}
|
|
20437
|
-
if (core2.executor.getManager(name) !== void 0) core2.executor.dropIndex(name);
|
|
20438
|
+
if (core2.executor.getManager(name) !== void 0) await core2.executor.dropIndex(name);
|
|
20438
20439
|
core2.indexRegistry.delete(name);
|
|
20439
20440
|
core2.watermarkNotifier.forget(name);
|
|
20440
20441
|
core2.analysisRebuild.clearStale(name);
|
|
20441
|
-
if (entry.sync !== null
|
|
20442
|
+
if (entry.sync !== null || entry.changes !== null)
|
|
20443
|
+
emitSyncChange(core2.indexRegistry, { kind: "dropped", indexName: name });
|
|
20442
20444
|
});
|
|
20443
20445
|
await core2.querySuggestionHooks?.afterDrop(name);
|
|
20444
20446
|
await runLifecycleHook(core2, "onIndexDrop", { indexName: name, config: entry.config });
|
|
@@ -20533,7 +20535,7 @@ function storedArrayPositionGap(value) {
|
|
|
20533
20535
|
|
|
20534
20536
|
// src/engine/embed-code.ts
|
|
20535
20537
|
var embedCode = codeLoader(
|
|
20536
|
-
() => import('./embed-
|
|
20538
|
+
() => import('./embed-HA2I7RCF.mjs').then((code7) => {
|
|
20537
20539
|
code7.bindEmbedHost(optionalCodeHost());
|
|
20538
20540
|
return code7;
|
|
20539
20541
|
}),
|
|
@@ -20543,7 +20545,7 @@ var loadEmbedCode = embedCode.load;
|
|
|
20543
20545
|
|
|
20544
20546
|
// src/engine/optional-writes-code.ts
|
|
20545
20547
|
var optionalWrites = codeLoader(async () => {
|
|
20546
|
-
const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-
|
|
20548
|
+
const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-GC6JWMAF.mjs')]);
|
|
20547
20549
|
code7.bindOptionalWritesHost(optionalCodeHost(), segmentCodec2);
|
|
20548
20550
|
return code7;
|
|
20549
20551
|
}, "write");
|
|
@@ -22531,8 +22533,21 @@ async function updateDocumentBatch(ctx, indexName, updates, options, hold) {
|
|
|
22531
22533
|
return { succeeded, failed };
|
|
22532
22534
|
}
|
|
22533
22535
|
|
|
22536
|
+
// src/engine/memory/document-churn.ts
|
|
22537
|
+
var churnByIndex = /* @__PURE__ */ new Map();
|
|
22538
|
+
function noteDocumentChurn(indexName, documents2) {
|
|
22539
|
+
if (!(documents2 > 0)) return;
|
|
22540
|
+
churnByIndex.set(indexName, (churnByIndex.get(indexName) ?? 0) + documents2);
|
|
22541
|
+
}
|
|
22542
|
+
function documentChurnOf(indexName) {
|
|
22543
|
+
return churnByIndex.get(indexName) ?? 0;
|
|
22544
|
+
}
|
|
22545
|
+
|
|
22534
22546
|
// src/engine/memory/guarded-writes.ts
|
|
22535
22547
|
var EMPTY_DOCUMENT = {};
|
|
22548
|
+
function noteGroupedChurn(ctx, indexName, documents2) {
|
|
22549
|
+
if (ctx.memoryWriteBlock?.grouping !== void 0) noteDocumentChurn(indexName, documents2);
|
|
22550
|
+
}
|
|
22536
22551
|
function blockFor(ctx, indexName) {
|
|
22537
22552
|
const block = ctx.memoryWriteBlock;
|
|
22538
22553
|
if (block === void 0) return void 0;
|
|
@@ -22618,6 +22633,7 @@ async function insertDocumentBatch2(ctx, indexName, documents2, options, hold) {
|
|
|
22618
22633
|
async function updateDocument2(ctx, indexName, docId, document, options, hold) {
|
|
22619
22634
|
const block = blockFor(ctx, indexName);
|
|
22620
22635
|
if (block === void 0) return updateDocument(ctx, indexName, docId, document, options, hold);
|
|
22636
|
+
noteGroupedChurn(ctx, indexName, 1);
|
|
22621
22637
|
return withReservation(
|
|
22622
22638
|
block.grouping,
|
|
22623
22639
|
indexName,
|
|
@@ -22632,6 +22648,7 @@ async function updateDocumentBatch2(ctx, indexName, updates, options, hold) {
|
|
|
22632
22648
|
if (grouping === void 0 || !Array.isArray(updates) || updates.length === 0) {
|
|
22633
22649
|
return updateDocumentBatch(ctx, indexName, updates, options, hold);
|
|
22634
22650
|
}
|
|
22651
|
+
noteGroupedChurn(ctx, indexName, updates.length);
|
|
22635
22652
|
return writeInGroups(
|
|
22636
22653
|
grouping,
|
|
22637
22654
|
indexName,
|
|
@@ -22646,10 +22663,12 @@ async function updateDocumentBatch2(ctx, indexName, updates, options, hold) {
|
|
|
22646
22663
|
);
|
|
22647
22664
|
}
|
|
22648
22665
|
async function removeDocument4(ctx, indexName, docId, options, hold) {
|
|
22666
|
+
noteGroupedChurn(ctx, indexName, 1);
|
|
22649
22667
|
await removeDocument3(ctx, indexName, docId, options, hold);
|
|
22650
22668
|
ctx.memoryWriteBlock?.memoryReleased();
|
|
22651
22669
|
}
|
|
22652
22670
|
async function removeDocumentBatch2(ctx, indexName, docIds, options, hold) {
|
|
22671
|
+
if (Array.isArray(docIds)) noteGroupedChurn(ctx, indexName, docIds.length);
|
|
22653
22672
|
const result = await removeDocumentBatch(ctx, indexName, docIds, options, hold);
|
|
22654
22673
|
if (result.succeeded.length > 0) ctx.memoryWriteBlock?.memoryReleased();
|
|
22655
22674
|
return result;
|
|
@@ -22669,7 +22688,7 @@ var suggestionsCode = codeLoader(async () => {
|
|
|
22669
22688
|
const [msgpack, suggestionStore2, code7] = await Promise.all([
|
|
22670
22689
|
loadMessagePack(),
|
|
22671
22690
|
loadSuggestionStore(),
|
|
22672
|
-
import('./suggestions-leaf-
|
|
22691
|
+
import('./suggestions-leaf-PSFCT5EX.mjs')
|
|
22673
22692
|
]);
|
|
22674
22693
|
code7.bindSuggestionsHost(optionalCodeHost(), msgpack, suggestionStore2);
|
|
22675
22694
|
return code7;
|
|
@@ -22679,7 +22698,7 @@ var loadSuggestionsCode = suggestionsCode.load;
|
|
|
22679
22698
|
// src/serialization/gzip-code.ts
|
|
22680
22699
|
var loading2 = null;
|
|
22681
22700
|
function loadGzip() {
|
|
22682
|
-
loading2 ??= import('./gzip.react-native-
|
|
22701
|
+
loading2 ??= import('./gzip.react-native-CVM4NQG2.mjs').catch((cause) => {
|
|
22683
22702
|
loading2 = null;
|
|
22684
22703
|
throw cause;
|
|
22685
22704
|
});
|
|
@@ -23116,14 +23135,27 @@ function ownReadsOf(current, vectorIndexes) {
|
|
|
23116
23135
|
}
|
|
23117
23136
|
};
|
|
23118
23137
|
}
|
|
23119
|
-
function
|
|
23138
|
+
function createSearchRetirement(pins, indexName, pending = /* @__PURE__ */ new Map()) {
|
|
23139
|
+
return (free) => {
|
|
23140
|
+
pins.afterRelease(() => {
|
|
23141
|
+
const disposal = free();
|
|
23142
|
+
if (disposal === void 0) return;
|
|
23143
|
+
pending.set(disposal, indexName);
|
|
23144
|
+
void disposal.then(
|
|
23145
|
+
() => pending.delete(disposal),
|
|
23146
|
+
() => pending.delete(disposal)
|
|
23147
|
+
);
|
|
23148
|
+
});
|
|
23149
|
+
const disposals = [...pending].filter(([, owner]) => owner === indexName).map(([disposal]) => disposal);
|
|
23150
|
+
return Promise.all(disposals).then(() => void 0);
|
|
23151
|
+
};
|
|
23152
|
+
}
|
|
23153
|
+
function replaceVectorIndexes(current, replacement, retire2) {
|
|
23120
23154
|
const kept = new Set(replacement.values());
|
|
23121
23155
|
const retired = [...current.values()].filter((index) => !kept.has(index));
|
|
23122
23156
|
current.clear();
|
|
23123
23157
|
for (const [field, index] of replacement) current.set(field, index);
|
|
23124
|
-
|
|
23125
|
-
for (const index of retired) index.dispose();
|
|
23126
|
-
});
|
|
23158
|
+
return retire2(() => Promise.all(retired.map((index) => index.dispose())).then(() => void 0));
|
|
23127
23159
|
}
|
|
23128
23160
|
function watchVectorWritesFor(vectorIndexes, pins) {
|
|
23129
23161
|
const watched = /* @__PURE__ */ new Map();
|
|
@@ -23655,7 +23687,7 @@ function partitionStatsOf(partitions) {
|
|
|
23655
23687
|
}
|
|
23656
23688
|
|
|
23657
23689
|
// src/partitioning/manager/index.ts
|
|
23658
|
-
function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes) {
|
|
23690
|
+
function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes, pendingDisposals) {
|
|
23659
23691
|
let config = initialConfig;
|
|
23660
23692
|
let language = initialLanguage;
|
|
23661
23693
|
requirePatternSearchFor(config.schema);
|
|
@@ -23670,6 +23702,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
23670
23702
|
const docPartitionMap = createDocIdMap();
|
|
23671
23703
|
const writeLogs = createWriteLogRecorder();
|
|
23672
23704
|
const pins = createStatePins(() => [...vecIndexes.keys()]);
|
|
23705
|
+
const afterSearchesRelease = createSearchRetirement(pins, indexName, pendingDisposals);
|
|
23673
23706
|
const vectorWrites = watchVectorWritesFor(vecIndexes, pins);
|
|
23674
23707
|
const ownReads = ownReadsOf({ locate: locateDocument, partitionOf }, vecIndexes);
|
|
23675
23708
|
for (let i = 0; i < count; i++) {
|
|
@@ -23897,9 +23930,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
23897
23930
|
vectorWrites.watch();
|
|
23898
23931
|
return pins.open(reads ?? ownReads.current());
|
|
23899
23932
|
},
|
|
23900
|
-
afterSearchesRelease
|
|
23901
|
-
pins.afterRelease(free);
|
|
23902
|
-
},
|
|
23933
|
+
afterSearchesRelease,
|
|
23903
23934
|
fieldValues(docId, fieldPaths) {
|
|
23904
23935
|
const pid = locateDocument(docId);
|
|
23905
23936
|
return pid === void 0 ? void 0 : partitions[pid].fieldValues(docId, fieldPaths);
|
|
@@ -23958,7 +23989,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
|
|
|
23958
23989
|
return vecIndexes;
|
|
23959
23990
|
},
|
|
23960
23991
|
resetVectorIndexes(newIndexes) {
|
|
23961
|
-
replaceVectorIndexes(vecIndexes, newIndexes,
|
|
23992
|
+
return replaceVectorIndexes(vecIndexes, newIndexes, afterSearchesRelease);
|
|
23962
23993
|
}
|
|
23963
23994
|
};
|
|
23964
23995
|
return manager;
|
|
@@ -23994,7 +24025,8 @@ function createPartitionRouter() {
|
|
|
23994
24025
|
|
|
23995
24026
|
// src/engine/sync-epoch.ts
|
|
23996
24027
|
async function holdSyncEpochChange(core2, indexName) {
|
|
23997
|
-
|
|
24028
|
+
const entry = core2.indexRegistry.get(indexName);
|
|
24029
|
+
if (entry === void 0 || entry.sync === null && entry.changes === null) return () => void 0;
|
|
23998
24030
|
return (await loadStorageCode()).holdRenewedSyncEpoch(core2, indexName);
|
|
23999
24031
|
}
|
|
24000
24032
|
async function withRenewedSyncEpoch(core2, indexName, change) {
|
|
@@ -24283,7 +24315,7 @@ var workerCopies = codeLoader(async () => {
|
|
|
24283
24315
|
const [segmentCodec2, segmentMerge2, code7] = await Promise.all([
|
|
24284
24316
|
loadSegmentCodec(),
|
|
24285
24317
|
loadSegmentMerge(),
|
|
24286
|
-
import('./worker-copies-
|
|
24318
|
+
import('./worker-copies-QRMISMEL.mjs')
|
|
24287
24319
|
]);
|
|
24288
24320
|
code7.bindWorkerCopiesHost(optionalCodeHost(), segmentCodec2, segmentMerge2);
|
|
24289
24321
|
return code7;
|
|
@@ -24509,7 +24541,7 @@ var loaded2 = null;
|
|
|
24509
24541
|
var loading3 = null;
|
|
24510
24542
|
function importOptionalReads() {
|
|
24511
24543
|
if (loaded2 !== null) return Promise.resolve(loaded2);
|
|
24512
|
-
loading3 ??= import('./optional-reads-
|
|
24544
|
+
loading3 ??= import('./optional-reads-AFPO2FEB.mjs').then(
|
|
24513
24545
|
(code7) => {
|
|
24514
24546
|
code7.bindOptionalReadsHost(optionalCodeHost());
|
|
24515
24547
|
loaded2 = code7;
|
|
@@ -24675,9 +24707,136 @@ var PATTERN_RUN_HEAP_BYTES = 512;
|
|
|
24675
24707
|
var ENUM_VALUE_HEAP_BYTES = 256;
|
|
24676
24708
|
var VECTOR_COMPONENT_HEAP_BYTES = 80;
|
|
24677
24709
|
var VECTOR_DOCUMENT_HEAP_BYTES = 5120;
|
|
24710
|
+
var MAP_TABLE_HEADER_BYTES = 40;
|
|
24711
|
+
var MAP_TABLE_SLOT_BYTES = 28;
|
|
24712
|
+
var MAP_TABLE_MIN_CAPACITY = 4;
|
|
24713
|
+
var MAP_TABLE_SHRINK_DIVISOR = 4;
|
|
24678
24714
|
var NORMALIZATION_EXPANSION_FACTOR = 3;
|
|
24679
24715
|
var CASE_FOLD_EXPANSION_FACTOR = 3;
|
|
24680
24716
|
|
|
24717
|
+
// src/engine/memory/table-model.ts
|
|
24718
|
+
function capacityFor2(entries) {
|
|
24719
|
+
if (entries <= MAP_TABLE_MIN_CAPACITY) return MAP_TABLE_MIN_CAPACITY;
|
|
24720
|
+
return 2 ** Math.ceil(Math.log2(entries));
|
|
24721
|
+
}
|
|
24722
|
+
function largestCapacityFor(entries) {
|
|
24723
|
+
return Math.max(capacityFor2(entries), 2 ** Math.floor(Math.log2(MAP_TABLE_SHRINK_DIVISOR * (entries + 1))));
|
|
24724
|
+
}
|
|
24725
|
+
function resetModel(model, shape, deleted) {
|
|
24726
|
+
model.deleted = deleted;
|
|
24727
|
+
model.resetEntries = shape.largest;
|
|
24728
|
+
model.resetDeleted = deleted;
|
|
24729
|
+
model.resetSmallestCapacity = capacityFor2(shape.smallest);
|
|
24730
|
+
model.resetLargestCapacity = largestCapacityFor(shape.largest);
|
|
24731
|
+
model.addedAtLeast = 0;
|
|
24732
|
+
model.addedAtMost = 0;
|
|
24733
|
+
model.deletedSinceRehashBecamePossible = null;
|
|
24734
|
+
}
|
|
24735
|
+
function createTableModel(entries, churn, deleted, shape) {
|
|
24736
|
+
const model = {
|
|
24737
|
+
entries,
|
|
24738
|
+
churn,
|
|
24739
|
+
deleted,
|
|
24740
|
+
resetEntries: 0,
|
|
24741
|
+
resetDeleted: 0,
|
|
24742
|
+
resetSmallestCapacity: 0,
|
|
24743
|
+
resetLargestCapacity: 0,
|
|
24744
|
+
addedAtLeast: 0,
|
|
24745
|
+
addedAtMost: 0,
|
|
24746
|
+
deletedSinceRehashBecamePossible: null
|
|
24747
|
+
};
|
|
24748
|
+
resetModel(model, shape, deleted);
|
|
24749
|
+
return model;
|
|
24750
|
+
}
|
|
24751
|
+
function observeTable(model, entries, churn, shape) {
|
|
24752
|
+
const churned = Math.max(0, churn - model.churn);
|
|
24753
|
+
const change = entries - model.entries;
|
|
24754
|
+
const deleted = Math.max(churned, -change);
|
|
24755
|
+
const lowest = Math.max(0, Math.min(model.entries, entries) - deleted);
|
|
24756
|
+
model.entries = entries;
|
|
24757
|
+
model.churn = churn;
|
|
24758
|
+
model.deleted += deleted;
|
|
24759
|
+
model.addedAtLeast += Math.max(0, change);
|
|
24760
|
+
model.addedAtMost += Math.max(0, change) + churned;
|
|
24761
|
+
if (entries === 0) {
|
|
24762
|
+
resetModel(model, shape, Math.min(model.deleted, MAP_TABLE_MIN_CAPACITY));
|
|
24763
|
+
return;
|
|
24764
|
+
}
|
|
24765
|
+
if (shape.shards !== 1) return;
|
|
24766
|
+
if (model.deletedSinceRehashBecamePossible !== null) {
|
|
24767
|
+
model.deletedSinceRehashBecamePossible += deleted;
|
|
24768
|
+
} else if (model.resetEntries + model.resetDeleted + model.addedAtMost >= model.resetSmallestCapacity || lowest < model.resetLargestCapacity / MAP_TABLE_SHRINK_DIVISOR) {
|
|
24769
|
+
model.deletedSinceRehashBecamePossible = deleted;
|
|
24770
|
+
}
|
|
24771
|
+
if (model.addedAtLeast > model.resetLargestCapacity - model.resetEntries || entries < model.resetSmallestCapacity / MAP_TABLE_SHRINK_DIVISOR) {
|
|
24772
|
+
resetModel(model, shape, model.deletedSinceRehashBecamePossible ?? model.deleted);
|
|
24773
|
+
}
|
|
24774
|
+
}
|
|
24775
|
+
function tableGrowthBytes(model, shape, added) {
|
|
24776
|
+
if (added <= 0) return 0;
|
|
24777
|
+
const largestCapacity = largestCapacityFor(shape.largest);
|
|
24778
|
+
let grownBytes2 = 0;
|
|
24779
|
+
for (let capacity = capacityFor2(shape.smallest); capacity <= largestCapacity; capacity *= 2) {
|
|
24780
|
+
const lastOccupied = shape.largest + added - 1;
|
|
24781
|
+
const deletedSlots = Math.max(0, Math.min(model.deleted, capacity - shape.largest));
|
|
24782
|
+
if (lastOccupied + deletedSlots < capacity) continue;
|
|
24783
|
+
const entriesAfter = shape.largest + added;
|
|
24784
|
+
const rebuildsAtSize = deletedSlots >= capacity / 2;
|
|
24785
|
+
const doubles = lastOccupied + Math.min(deletedSlots, capacity / 2 - 1) >= capacity;
|
|
24786
|
+
const rebuiltBytes = rebuildsAtSize ? allocatedTableBytes(capacity, entriesAfter) : 0;
|
|
24787
|
+
const doubledBytes = doubles ? allocatedTableBytes(capacity * 2, entriesAfter) : 0;
|
|
24788
|
+
grownBytes2 = Math.max(grownBytes2, rebuiltBytes, doubledBytes);
|
|
24789
|
+
}
|
|
24790
|
+
return shape.shards * grownBytes2;
|
|
24791
|
+
}
|
|
24792
|
+
function allocatedTableBytes(firstCapacity, entriesAfter) {
|
|
24793
|
+
let capacity = firstCapacity;
|
|
24794
|
+
let bytes = MAP_TABLE_HEADER_BYTES + MAP_TABLE_SLOT_BYTES * capacity;
|
|
24795
|
+
while (entriesAfter > capacity) {
|
|
24796
|
+
capacity *= 2;
|
|
24797
|
+
bytes += MAP_TABLE_HEADER_BYTES + MAP_TABLE_SLOT_BYTES * capacity;
|
|
24798
|
+
}
|
|
24799
|
+
return bytes;
|
|
24800
|
+
}
|
|
24801
|
+
function createDocumentTableGrowth(core2, heldTableSizes) {
|
|
24802
|
+
const modelsByIndex = /* @__PURE__ */ new Map();
|
|
24803
|
+
return (indexName, documents2, pendingDocuments) => {
|
|
24804
|
+
const manager = core2.executor.getManager(indexName);
|
|
24805
|
+
if (manager === void 0 || manager === null) {
|
|
24806
|
+
modelsByIndex.delete(indexName);
|
|
24807
|
+
return 0;
|
|
24808
|
+
}
|
|
24809
|
+
const previous = modelsByIndex.get(indexName);
|
|
24810
|
+
const models = /* @__PURE__ */ new Map();
|
|
24811
|
+
modelsByIndex.set(indexName, models);
|
|
24812
|
+
const churn = documentChurnOf(indexName);
|
|
24813
|
+
let bytes = 0;
|
|
24814
|
+
const measure2 = (key, entries, shape, followsRemoves) => {
|
|
24815
|
+
let model = previous?.get(key);
|
|
24816
|
+
if (model === void 0) {
|
|
24817
|
+
model = createTableModel(entries, churn, followsRemoves ? churn : Number.POSITIVE_INFINITY, shape);
|
|
24818
|
+
} else {
|
|
24819
|
+
observeTable(model, entries, churn, shape);
|
|
24820
|
+
}
|
|
24821
|
+
models.set(key, model);
|
|
24822
|
+
if (documents2 <= 0) return;
|
|
24823
|
+
bytes += tableGrowthBytes(model, shape, pendingDocuments + documents2) - tableGrowthBytes(model, shape, pendingDocuments);
|
|
24824
|
+
};
|
|
24825
|
+
const located = manager.countDocuments();
|
|
24826
|
+
measure2("located", located, shardEntryRangeOf(located), true);
|
|
24827
|
+
for (const partition of manager.getAllPartitions()) {
|
|
24828
|
+
const entries = (isCompositePartition(partition) ? partition.live : partition).count();
|
|
24829
|
+
measure2(`partition:${partition.partitionId}`, entries, shardEntryRangeOf(entries), true);
|
|
24830
|
+
}
|
|
24831
|
+
for (const [field, vectorIndex] of manager.getVectorIndexes()) {
|
|
24832
|
+
vectorIndex.visitDocumentTables(
|
|
24833
|
+
(table2, entries, followsRemoves) => measure2(`vector:${field}:${table2}`, entries, shardEntryRangeOf(entries), followsRemoves)
|
|
24834
|
+
);
|
|
24835
|
+
}
|
|
24836
|
+
return bytes;
|
|
24837
|
+
};
|
|
24838
|
+
}
|
|
24839
|
+
|
|
24681
24840
|
// src/engine/memory/grouped-writes.ts
|
|
24682
24841
|
function exactCounter(projection, indexName, bounds, documents2) {
|
|
24683
24842
|
const counted = /* @__PURE__ */ new Set();
|
|
@@ -25154,15 +25313,28 @@ function processRoomIn(figures, fractions) {
|
|
|
25154
25313
|
}
|
|
25155
25314
|
function createWriteProjection(options) {
|
|
25156
25315
|
const bounds = /* @__PURE__ */ new Map();
|
|
25316
|
+
const pendingDocuments = /* @__PURE__ */ new Map();
|
|
25157
25317
|
const { refusal: refusal3 } = options;
|
|
25318
|
+
function settlePending(indexName, count) {
|
|
25319
|
+
const remaining = (pendingDocuments.get(indexName) ?? 0) - count;
|
|
25320
|
+
if (remaining > 0) pendingDocuments.set(indexName, remaining);
|
|
25321
|
+
else pendingDocuments.delete(indexName);
|
|
25322
|
+
}
|
|
25158
25323
|
function fittingCount(indexName, figures, groupBounds, start, mostDocuments, countExactly) {
|
|
25159
25324
|
const end = Math.min(groupBounds.length, start + mostDocuments);
|
|
25160
25325
|
if (figures === null) return end - start;
|
|
25161
25326
|
const reserved = reservedHeapBytes();
|
|
25162
25327
|
const heapRoom = heapRoomIn(figures, options.fractions) - reserved;
|
|
25163
25328
|
const processRoom = processRoomIn(figures, options.fractions) - reserved;
|
|
25164
|
-
const
|
|
25165
|
-
const
|
|
25329
|
+
const pending = pendingDocuments.get(indexName) ?? 0;
|
|
25330
|
+
const mostTableGrowth = options.documentTableGrowthBytesOf(indexName, end - start, pending);
|
|
25331
|
+
const mostVectorGrowth = options.vectorGrowthBytesOf(indexName, end - start);
|
|
25332
|
+
const fits = (next, count2) => {
|
|
25333
|
+
const most = next + mostTableGrowth;
|
|
25334
|
+
if (most <= heapRoom && most + mostVectorGrowth <= processRoom) return true;
|
|
25335
|
+
const withTables = next + options.documentTableGrowthBytesOf(indexName, count2 + 1, pending);
|
|
25336
|
+
return withTables <= heapRoom && withTables + options.vectorGrowthBytesOf(indexName, count2 + 1) <= processRoom;
|
|
25337
|
+
};
|
|
25166
25338
|
let taken = 0;
|
|
25167
25339
|
let count = 0;
|
|
25168
25340
|
while (start + count < end) {
|
|
@@ -25177,10 +25349,22 @@ function createWriteProjection(options) {
|
|
|
25177
25349
|
return count;
|
|
25178
25350
|
}
|
|
25179
25351
|
function reserve(indexName, groupBounds, start, count) {
|
|
25180
|
-
|
|
25352
|
+
if (count === 0) return UNPROJECTED;
|
|
25353
|
+
const pending = pendingDocuments.get(indexName) ?? 0;
|
|
25354
|
+
let bytes = options.vectorGrowthBytesOf(indexName, count) + options.documentTableGrowthBytesOf(indexName, count, pending);
|
|
25181
25355
|
for (let index = start; index < start + count; index++) bytes += groupBounds[index];
|
|
25182
25356
|
const reservation = reserveHeapBytes(bytes);
|
|
25183
|
-
|
|
25357
|
+
pendingDocuments.set(indexName, pending + count);
|
|
25358
|
+
let released = false;
|
|
25359
|
+
return {
|
|
25360
|
+
count,
|
|
25361
|
+
release: () => {
|
|
25362
|
+
if (released) return;
|
|
25363
|
+
released = true;
|
|
25364
|
+
reservation.release();
|
|
25365
|
+
settlePending(indexName, count);
|
|
25366
|
+
}
|
|
25367
|
+
};
|
|
25184
25368
|
}
|
|
25185
25369
|
function blockBytesOf(figures) {
|
|
25186
25370
|
return Math.floor(
|
|
@@ -25332,7 +25516,8 @@ function createMemoryWriteBlock(deps) {
|
|
|
25332
25516
|
collections: () => monitor.collections(),
|
|
25333
25517
|
refusedAfterCollection: (figures) => monitor.refusedAfterCollection(figures),
|
|
25334
25518
|
analysisOf: (indexName) => writeAnalysisOf(deps.source, indexName),
|
|
25335
|
-
vectorGrowthBytesOf: (indexName, documents2) => vectorGrowthBytesOf(deps.source, indexName, documents2)
|
|
25519
|
+
vectorGrowthBytesOf: (indexName, documents2) => vectorGrowthBytesOf(deps.source, indexName, documents2),
|
|
25520
|
+
documentTableGrowthBytesOf: createDocumentTableGrowth(deps.source)
|
|
25336
25521
|
});
|
|
25337
25522
|
const grouped = {
|
|
25338
25523
|
boundOf: (indexName) => projection.boundOf(indexName),
|
|
@@ -25728,12 +25913,30 @@ function vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGrap
|
|
|
25728
25913
|
}
|
|
25729
25914
|
function disposeEntry(entry) {
|
|
25730
25915
|
closeCopyPublicationOrder(entry.copyPublications);
|
|
25731
|
-
entry.manager.afterSearchesRelease(() => {
|
|
25732
|
-
|
|
25916
|
+
return entry.manager.afterSearchesRelease(() => {
|
|
25917
|
+
const disposals = [...entry.vectorIndexes.values()].map((vectorIndex) => vectorIndex.dispose());
|
|
25733
25918
|
closeHeldVectorCopies(entry.vectorCopies);
|
|
25734
25919
|
for (const partition of entry.manager.getAllPartitions()) partition.clear();
|
|
25920
|
+
return Promise.all(disposals).then(() => void 0);
|
|
25735
25921
|
});
|
|
25736
25922
|
}
|
|
25923
|
+
function createEntryBuilder(vectorStorage, onVectorGraphRepaired, pendingDisposals) {
|
|
25924
|
+
return (indexName, config, language, analysisStale, awaitedCopyLoad, copies, savedPartitionCount) => {
|
|
25925
|
+
const router = createPartitionRouter();
|
|
25926
|
+
const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
|
|
25927
|
+
const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGraphRepaired);
|
|
25928
|
+
const manager = createPartitionManager(
|
|
25929
|
+
indexName,
|
|
25930
|
+
config,
|
|
25931
|
+
language,
|
|
25932
|
+
router,
|
|
25933
|
+
partitionCount,
|
|
25934
|
+
vectorIndexes,
|
|
25935
|
+
pendingDisposals
|
|
25936
|
+
);
|
|
25937
|
+
return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
|
|
25938
|
+
};
|
|
25939
|
+
}
|
|
25737
25940
|
function indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad) {
|
|
25738
25941
|
return {
|
|
25739
25942
|
manager,
|
|
@@ -25769,6 +25972,8 @@ function createDirectExecutor(options) {
|
|
|
25769
25972
|
const vectorWorkerCopies = options?.vectorWorkerCopies ?? NO_VECTOR_WORKER_COPIES;
|
|
25770
25973
|
const threadSlot = options?.threadSlot ?? 0;
|
|
25771
25974
|
const vectorStorage = options?.vectorStorage ?? "memory";
|
|
25975
|
+
const pendingDisposals = /* @__PURE__ */ new Map();
|
|
25976
|
+
const buildEntry = createEntryBuilder(vectorStorage, options?.onVectorGraphRepaired, pendingDisposals);
|
|
25772
25977
|
function requireIndex(indexName) {
|
|
25773
25978
|
const entry = indexes.get(indexName);
|
|
25774
25979
|
if (!entry) {
|
|
@@ -25802,21 +26007,15 @@ function createDirectExecutor(options) {
|
|
|
25802
26007
|
indexes.set(indexName, entry);
|
|
25803
26008
|
return entry.manager;
|
|
25804
26009
|
}
|
|
25805
|
-
function
|
|
25806
|
-
const
|
|
25807
|
-
const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
|
|
25808
|
-
const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, options?.onVectorGraphRepaired);
|
|
25809
|
-
const manager = createPartitionManager(indexName, config, language, router, partitionCount, vectorIndexes);
|
|
25810
|
-
return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
|
|
25811
|
-
}
|
|
25812
|
-
function dropIndex(indexName) {
|
|
25813
|
-
disposeEntry(requireIndex(indexName));
|
|
26010
|
+
async function dropIndex(indexName) {
|
|
26011
|
+
const entry = requireIndex(indexName);
|
|
25814
26012
|
indexes.delete(indexName);
|
|
26013
|
+
await disposeEntry(entry);
|
|
25815
26014
|
}
|
|
25816
|
-
function installDetachedIndex(detached) {
|
|
26015
|
+
async function installDetachedIndex(detached) {
|
|
25817
26016
|
const previous = indexes.get(detached.indexName);
|
|
25818
26017
|
indexes.set(detached.indexName, detached.entry);
|
|
25819
|
-
if (previous !== void 0 && previous !== detached.entry) disposeEntry(previous);
|
|
26018
|
+
if (previous !== void 0 && previous !== detached.entry) await disposeEntry(previous);
|
|
25820
26019
|
}
|
|
25821
26020
|
function listIndexes() {
|
|
25822
26021
|
return Array.from(indexes.keys());
|
|
@@ -25878,7 +26077,7 @@ function createDirectExecutor(options) {
|
|
|
25878
26077
|
options?.initializeCopyPublication?.(entry, action.publication, threadSlot);
|
|
25879
26078
|
}
|
|
25880
26079
|
} catch (err) {
|
|
25881
|
-
dropIndex(action.indexName);
|
|
26080
|
+
await dropIndex(action.indexName);
|
|
25882
26081
|
throw err;
|
|
25883
26082
|
}
|
|
25884
26083
|
return void 0;
|
|
@@ -25889,7 +26088,7 @@ function createDirectExecutor(options) {
|
|
|
25889
26088
|
return void 0;
|
|
25890
26089
|
}
|
|
25891
26090
|
case "dropIndex": {
|
|
25892
|
-
dropIndex(action.indexName);
|
|
26091
|
+
await dropIndex(action.indexName);
|
|
25893
26092
|
return void 0;
|
|
25894
26093
|
}
|
|
25895
26094
|
case "loadVectorCopy": {
|
|
@@ -25977,7 +26176,7 @@ function createDirectExecutor(options) {
|
|
|
25977
26176
|
case "clear": {
|
|
25978
26177
|
const entry = requireIndex(action.indexName);
|
|
25979
26178
|
entry.manager.clearPartitions();
|
|
25980
|
-
entry.manager.resetVectorIndexes(
|
|
26179
|
+
await entry.manager.resetVectorIndexes(
|
|
25981
26180
|
vectorIndexesFor(
|
|
25982
26181
|
action.indexName,
|
|
25983
26182
|
entry.config,
|
|
@@ -26015,6 +26214,7 @@ function createDirectExecutor(options) {
|
|
|
26015
26214
|
await entry.manager.publication.write(() => disposeEntry(entry));
|
|
26016
26215
|
}
|
|
26017
26216
|
indexes.clear();
|
|
26217
|
+
await Promise.all(pendingDisposals.keys());
|
|
26018
26218
|
return void 0;
|
|
26019
26219
|
}
|
|
26020
26220
|
}
|
|
@@ -26237,7 +26437,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
|
|
|
26237
26437
|
|
|
26238
26438
|
// src/engine/durability-config-code.ts
|
|
26239
26439
|
var durabilityConfig = codeLoader(
|
|
26240
|
-
() => import('./durability-config-
|
|
26440
|
+
() => import('./durability-config-FCSD4MXY.mjs').then((code7) => {
|
|
26241
26441
|
code7.bindDurabilityConfigHost(optionalCodeHost());
|
|
26242
26442
|
return code7;
|
|
26243
26443
|
}),
|
|
@@ -26638,7 +26838,7 @@ function wireIndexState(wiring) {
|
|
|
26638
26838
|
} catch (error) {
|
|
26639
26839
|
await orchestrator.closeIndex(indexName).catch(() => void 0);
|
|
26640
26840
|
await durability.manager.unloadIndex(indexName).catch(() => void 0);
|
|
26641
|
-
if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
|
|
26841
|
+
if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
|
|
26642
26842
|
throw error;
|
|
26643
26843
|
}
|
|
26644
26844
|
},
|
|
@@ -26656,7 +26856,7 @@ function wireIndexState(wiring) {
|
|
|
26656
26856
|
try {
|
|
26657
26857
|
await wiring.onClose?.(indexName);
|
|
26658
26858
|
} finally {
|
|
26659
|
-
if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
|
|
26859
|
+
if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
|
|
26660
26860
|
const entry = indexRegistry.get(indexName);
|
|
26661
26861
|
if (entry !== void 0) {
|
|
26662
26862
|
entry.documentCount = documentCount;
|
|
@@ -27962,6 +28162,17 @@ function bm25Operations(core2) {
|
|
|
27962
28162
|
};
|
|
27963
28163
|
}
|
|
27964
28164
|
|
|
28165
|
+
// src/narsil/changes.ts
|
|
28166
|
+
function changesOperations(core2) {
|
|
28167
|
+
return {
|
|
28168
|
+
updateChanges: async (indexName, setting) => (await loadStorageCode()).updateChangesOf(core2, indexName, setting),
|
|
28169
|
+
getChanges: async (indexName) => (await loadStorageCode()).changesOf(core2, indexName),
|
|
28170
|
+
async *followChanges(indexName, options) {
|
|
28171
|
+
yield* (await loadStorageCode()).followIndexChanges(core2, indexName, options);
|
|
28172
|
+
}
|
|
28173
|
+
};
|
|
28174
|
+
}
|
|
28175
|
+
|
|
27965
28176
|
// src/narsil/internals.ts
|
|
27966
28177
|
var engineCores = /* @__PURE__ */ new WeakMap();
|
|
27967
28178
|
var queryReadOptions = /* @__PURE__ */ new WeakMap();
|
|
@@ -27977,16 +28188,6 @@ function engineCoreOf(engine) {
|
|
|
27977
28188
|
|
|
27978
28189
|
// src/narsil/portability.ts
|
|
27979
28190
|
function portabilityOperations(core2, config, engine) {
|
|
27980
|
-
async function withOpenIndex2(indexName, action) {
|
|
27981
|
-
core2.guardShutdown();
|
|
27982
|
-
core2.requireIndex(indexName);
|
|
27983
|
-
const release = await core2.indexState.acquire(indexName);
|
|
27984
|
-
try {
|
|
27985
|
-
return await action();
|
|
27986
|
-
} finally {
|
|
27987
|
-
release();
|
|
27988
|
-
}
|
|
27989
|
-
}
|
|
27990
28191
|
function queueRestore(indexName, data) {
|
|
27991
28192
|
const { restoresInFlight } = core2;
|
|
27992
28193
|
const previous = restoresInFlight.get(indexName) ?? Promise.resolve();
|
|
@@ -28021,7 +28222,7 @@ function portabilityOperations(core2, config, engine) {
|
|
|
28021
28222
|
}
|
|
28022
28223
|
return {
|
|
28023
28224
|
snapshot(indexName, options) {
|
|
28024
|
-
return
|
|
28225
|
+
return withOpenIndex(core2, indexName, async () => {
|
|
28025
28226
|
const { createSnapshot } = await loadStorageCode();
|
|
28026
28227
|
return createSnapshot(snapshotDepsOf(indexName), options?.queryHistory === true ? core2 : null);
|
|
28027
28228
|
});
|
|
@@ -28033,10 +28234,9 @@ function portabilityOperations(core2, config, engine) {
|
|
|
28033
28234
|
core2.heapPressureNotifier.check(indexName);
|
|
28034
28235
|
},
|
|
28035
28236
|
exportDocuments(indexName) {
|
|
28036
|
-
return
|
|
28037
|
-
const {
|
|
28038
|
-
|
|
28039
|
-
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
28237
|
+
return withOpenIndex(core2, indexName, async () => {
|
|
28238
|
+
const { openDocumentExport } = await loadStorageCode();
|
|
28239
|
+
return openDocumentExport(core2, snapshotDepsOf(indexName));
|
|
28040
28240
|
});
|
|
28041
28241
|
},
|
|
28042
28242
|
importDocumentExport(indexName, data) {
|
|
@@ -28826,7 +29026,7 @@ async function executePreflight(request, callerContext) {
|
|
|
28826
29026
|
|
|
28827
29027
|
// src/engine/resolve-vector-text-code.ts
|
|
28828
29028
|
var resolveVectorText = codeLoader(
|
|
28829
|
-
() => import('./resolve-vector-text-
|
|
29029
|
+
() => import('./resolve-vector-text-GE2CRJKI.mjs').then((code7) => {
|
|
28830
29030
|
code7.bindResolveVectorTextHost(optionalCodeHost());
|
|
28831
29031
|
return code7;
|
|
28832
29032
|
}),
|
|
@@ -28911,6 +29111,7 @@ async function queryUnderHold(core2, indexName, params, resolvedParams, embedded
|
|
|
28911
29111
|
options?.onRanked?.(manager, result);
|
|
28912
29112
|
return result;
|
|
28913
29113
|
} catch (error) {
|
|
29114
|
+
if (error instanceof NarsilError && error.code === ErrorCodes.RERANK_FAILED) throw error;
|
|
28914
29115
|
if (runner?.replaced) return INDEX_REPLACED_DURING_RERANK;
|
|
28915
29116
|
throw error;
|
|
28916
29117
|
} finally {
|
|
@@ -29259,6 +29460,7 @@ function createNarsilFromCore(core2, config) {
|
|
|
29259
29460
|
...synonymOperations(core2),
|
|
29260
29461
|
...bm25Operations(core2),
|
|
29261
29462
|
...syncOperations(core2),
|
|
29463
|
+
...changesOperations(core2),
|
|
29262
29464
|
async checkpoint(indexName) {
|
|
29263
29465
|
guardShutdown();
|
|
29264
29466
|
requireIndex(indexName);
|
|
@@ -29385,4 +29587,4 @@ async function createNarsil(config) {
|
|
|
29385
29587
|
// src/index.ts
|
|
29386
29588
|
var VERSION = "0.1.0";
|
|
29387
29589
|
|
|
29388
|
-
export { ARRAY_POSITION_GAP, COMPACTION_SEGMENT_TRIGGER, DEFAULT_BM25_B, DEFAULT_BM25_K1, DEFAULT_COPY_IDLE_TIMEOUT_MS, DEFAULT_COPY_THRESHOLD, GROUP_FORMAT, GROUP_PATTERN_SOURCE, GROWING_PARTIAL_ENTRY_BYTES, GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY, GROWING_PARTIAL_PENDING_ENTRY_BYTES, GROWING_PARTIAL_RUN_BYTES, GROWING_PARTIAL_RUN_MEMBER_BYTES, GrowingSegment, IDLE_MERGE_DELAY_MS, LIVE_TAIL_FLUSH_DOCUMENTS, LIVE_TAIL_FREEZE_FLOOR, LOAD_BUFFER_YIELD_INTERVAL, LONG_QUERY_THREADS, LivePostings2 as LivePostings, MAIN_COPY_LONE_QUERY_DOCUMENTS, MAX_PENDING_REPLICATION_DOCUMENTS, NO_REMOVED_SPELLINGS, PARTIAL_WORD_RUN_CODE_POINTS, POOL_RESTART_DELAY_MAX_MS, POOL_RESTART_DELAY_MS, PoolPlan, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, RUN_MEMBER_START_CAPACITY, RUN_TABLE_START_CAPACITY, SEGMENTS_PER_MERGE, SLICE_CAPACITIES, SUGGESTIONS_INDEX_INFIX, SURFACE_TABLE_START_CAPACITY, SegmentRefusal, StringPlan, SurfaceTable, TERM_REGION_GROWTH_FACTOR, TERM_SLOT_LOAD_DENOMINATOR, TERM_SLOT_LOAD_NUMERATOR, TermLookup, VERSION, afterCurrentTurn, arrayPositionsAreStale, assemblePagedFrozenSegment, availablePatternSearch, bindOptionalWritesHost, bindSegmentCodecHost, bindSegmentMergeHost, buildPartialWordTableFrom, clearNormalizationCache, codePointCountOf, compareScores, configurationPayloadOf, configureNormalizationCache, countDocumentSpellings, countSpelling, createBooleanIndex, createCompositePartition, createEncodedDocumentSource, createEngineIndex, createEnumIndex, createFrozenRemovals, createFrozenSegment, createLoadedGeoIndex, createNarsil, createNumericIndex, createPartitionIndex, createPartitionManager, createPartitionRouter, createPublicationGate, createSharedFrozenSegment, createSpellingTable, createSurfaceRegistry, createWorkerFactory, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, decodeSurfaceTable, dropEngineIndex, emitEngineEvent, emitSyncChange, emitWriteEventAfter, emptyPendingRegions, encodeDocumentTableData, encodeExternalIdTableData, encodeFieldIndexes, encodeFrozenTokenTableData, encodeLookupKey, encodePartialSpellings, encodePartialSpellingsOf, encodeSegmentState, encodeStringBlob, encodeSurfaceTable, endOfValue, engineCoreOf, expansionSource, generateId, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, getVectorFieldPaths, growPartitionsTo, grownCapacity, hasLanguage, hasStopWords, hasTokenizer, holdSyncEpochChange, holdVectorsForRollback, insertDocument, insertDocumentBatch, insertDocumentVectors, isCompositePartition, isSimdAvailable, isSyncEpoch, kWayMerge, liveFrequency, loadDigest, loadGzip, loadOptionalWrites, loadSchemaCodeFor, loadStorageCode, loadSuggestionsCode, lookupOfStoredSynonyms, mergeDocFrequencies, mergeFacets, mergeFieldRegions, mergeKeywordSources, mergePartitionStats, mergePostings, mergePostings2, mergeStoredFields, mergeText, mergeTextAt, newSyncEpoch, oneAtATime, oversampledFacetConfig, oversizedConfigurationPayloadOf, partialSpellingsOfDocuments, partitionDocumentFrequency, partitionStateOf, patternHost, patternIndexOf, prepareConfiguredSynonyms, prepareDocumentText, prepareDocumentVectors, prepareDocumentWrite, prepareRemovalText, prepareStoredSynonyms, readHeapStatistics, readResidentMemory, rebuildSizeIndexes, reconstructSchemaFromMetadata, recordValueSize, regionsOverlap, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, releaseRange, removeDocument3 as removeDocument, removeDocumentBatch, removeDocumentBatch2, removeDocumentVectors, removedSurfaceSpellings, requireEncodedConfigurationWithinSizeLimit, requireLoadedVectorCode, requirePatternSearch, requireRoom, requireSegment, requireSurfaceFormsForPartialFields, reserveStrings, resetNormalizationCache, resolveIndexAnalysis, resolvePartialWordAnalysis, resolvePartitionInsertOptions, resolveStopWords, returnsEveryMatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, rulesOfStoredSynonyms, sameFields, scanPostingBlocks, spellingCountsOf, storedArrayPositionGap, storedBM25Params, storedDocumentsOf, survivorDocumentsOf, termText, tokenize, topLevelMapKeys, transformToken, typedRegion, updateDocument, updateDocumentBatch, updateDocumentVectors, validateBM25Params, validateEmbeddingConfig, validatePartitionConfig, validatePatternValueLimit, validateRequiredFieldsInSchema, visitDocumentSpellings, visitDocumentSurfaceSpellings, withOpenIndex, workersEnabledByDefault, wrapFrozenTokenTable, writePartitionDocument, yieldToEventLoop };
|
|
29590
|
+
export { ARRAY_POSITION_GAP, COMPACTION_SEGMENT_TRIGGER, DEFAULT_BM25_B, DEFAULT_BM25_K1, DEFAULT_COPY_IDLE_TIMEOUT_MS, DEFAULT_COPY_THRESHOLD, GROUP_FORMAT, GROUP_PATTERN_SOURCE, GROWING_PARTIAL_ENTRY_BYTES, GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY, GROWING_PARTIAL_PENDING_ENTRY_BYTES, GROWING_PARTIAL_RUN_BYTES, GROWING_PARTIAL_RUN_MEMBER_BYTES, GrowingSegment, IDLE_MERGE_DELAY_MS, LIVE_TAIL_FLUSH_DOCUMENTS, LIVE_TAIL_FREEZE_FLOOR, LOAD_BUFFER_YIELD_INTERVAL, LONG_QUERY_THREADS, LivePostings2 as LivePostings, MAIN_COPY_LONE_QUERY_DOCUMENTS, MAX_PENDING_REPLICATION_DOCUMENTS, NO_REMOVED_SPELLINGS, PARTIAL_WORD_RUN_CODE_POINTS, POOL_RESTART_DELAY_MAX_MS, POOL_RESTART_DELAY_MS, PoolPlan, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, RUN_MEMBER_START_CAPACITY, RUN_TABLE_START_CAPACITY, SEGMENTS_PER_MERGE, SLICE_CAPACITIES, SUGGESTIONS_INDEX_INFIX, SURFACE_TABLE_START_CAPACITY, SegmentRefusal, StringPlan, SurfaceTable, TERM_REGION_GROWTH_FACTOR, TERM_SLOT_LOAD_DENOMINATOR, TERM_SLOT_LOAD_NUMERATOR, TermLookup, VERSION, afterCurrentTurn, arrayPositionsAreStale, assemblePagedFrozenSegment, availablePatternSearch, bindOptionalWritesHost, bindSegmentCodecHost, bindSegmentMergeHost, buildPartialWordTableFrom, clearNormalizationCache, codePointCountOf, compareScores, configurationPayloadOf, configureNormalizationCache, countDocumentSpellings, countSpelling, createBooleanIndex, createCompositePartition, createEncodedDocumentSource, createEngineIndex, createEnumIndex, createFrozenRemovals, createFrozenSegment, createLoadedGeoIndex, createNarsil, createNumericIndex, createPartitionIndex, createPartitionManager, createPartitionRouter, createPatternWorkMeter, createPublicationGate, createSharedFrozenSegment, createSpellingTable, createSurfaceRegistry, createWorkerFactory, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, decodeSurfaceTable, dropEngineIndex, emitEngineEvent, emitSyncChange, emitWriteEventAfter, emptyPendingRegions, encodeDocumentTableData, encodeExternalIdTableData, encodeFieldIndexes, encodeFrozenTokenTableData, encodeLookupKey, encodePartialSpellings, encodePartialSpellingsOf, encodeSegmentState, encodeStringBlob, encodeSurfaceTable, endOfValue, engineCoreOf, expansionSource, generateId, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, getVectorFieldPaths, growPartitionsTo, grownCapacity, hasLanguage, hasStopWords, hasTokenizer, holdSyncEpochChange, holdVectorsForRollback, insertDocument, insertDocumentBatch, insertDocumentVectors, isCompositePartition, isSimdAvailable, isSyncEpoch, kWayMerge, liveFrequency, loadDigest, loadGzip, loadOptionalWrites, loadSchemaCodeFor, loadStorageCode, loadSuggestionsCode, lookupOfStoredSynonyms, mergeDocFrequencies, mergeFacets, mergeFieldRegions, mergeKeywordSources, mergePartitionStats, mergePostings, mergePostings2, mergeStoredFields, mergeText, mergeTextAt, newSyncEpoch, noteDocumentChurn, oneAtATime, oversampledFacetConfig, oversizedConfigurationPayloadOf, partialSpellingsOfDocuments, partitionDocumentFrequency, partitionStateOf, patternHost, patternIndexOf, prepareConfiguredSynonyms, prepareDocumentText, prepareDocumentVectors, prepareDocumentWrite, prepareRemovalText, prepareStoredSynonyms, readHeapStatistics, readResidentMemory, rebuildSizeIndexes, reconstructSchemaFromMetadata, recordValueSize, regionsOverlap, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, releaseRange, removeDocument3 as removeDocument, removeDocumentBatch, removeDocumentBatch2, removeDocumentVectors, removedSurfaceSpellings, requireEncodedConfigurationWithinSizeLimit, requireLoadedVectorCode, requirePatternSearch, requireRoom, requireSegment, requireSurfaceFormsForPartialFields, reserveStrings, resetNormalizationCache, resolveIndexAnalysis, resolvePartialWordAnalysis, resolvePartitionInsertOptions, resolveStopWords, returnsEveryMatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, rulesOfStoredSynonyms, sameFields, scanPostingBlocks, spellingCountsOf, storedArrayPositionGap, storedBM25Params, storedDocumentsOf, survivorDocumentsOf, termText, tokenize, topLevelMapKeys, transformToken, typedRegion, updateDocument, updateDocumentBatch, updateDocumentVectors, validQueryFilter, validateBM25Params, validateEmbeddingConfig, validatePartitionConfig, validatePatternValueLimit, validateRequiredFieldsInSchema, visitDocumentSpellings, visitDocumentSurfaceSpellings, withOpenIndex, workersEnabledByDefault, wrapFrozenTokenTable, writePartitionDocument, yieldToEventLoop };
|