@delali/narsil 0.3.1-next.145 → 0.3.1-next.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/filesystem.mjs +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/analysis-change-ZCJNYBJM.mjs +39 -0
- package/dist/{analysis-change-entry-V4SQQSXQ.mjs → analysis-change-entry-YN3ELL6C.mjs} +1 -1
- package/dist/browser/{analysis-change-QTCQ5ETU.mjs → analysis-change-M65AZQQG.mjs} +8 -5
- package/dist/browser/{analysis-change-entry-KYEQSP3I.mjs → analysis-change-entry-H3YIOLXZ.mjs} +1 -1
- package/dist/browser/{chunk-GP4QLUQM.mjs → chunk-2JABMB4S.mjs} +10 -6
- package/dist/browser/{chunk-5WYWLTM5.mjs → chunk-4DYLCICG.mjs} +2 -2
- package/dist/browser/{chunk-75PMIFQA.mjs → chunk-4RD3AFSB.mjs} +1 -1
- package/dist/browser/{chunk-XWMEGKDC.mjs → chunk-5V74FFZE.mjs} +2 -2
- package/dist/browser/{chunk-PMBSBSCN.mjs → chunk-6OWX3OP2.mjs} +2 -2
- package/dist/browser/chunk-BRWY3JCN.mjs +678 -0
- package/dist/browser/{chunk-ZALEKEUH.mjs → chunk-BVX2MEHA.mjs} +306 -607
- package/dist/browser/{chunk-FXPMF65P.mjs → chunk-D6UFGBF5.mjs} +15 -45
- package/dist/browser/{chunk-QNDWMPV2.mjs → chunk-IAXZAVYL.mjs} +25 -66
- package/dist/browser/chunk-JNOAKDUM.mjs +31 -0
- package/dist/browser/{chunk-BTMRV5MY.mjs → chunk-KAEVGLYN.mjs} +2 -2
- package/dist/browser/{chunk-FHO5N7FD.mjs → chunk-LURXVCHG.mjs} +1 -1
- package/dist/browser/chunk-MPK76GVS.mjs +63 -0
- package/dist/browser/{chunk-6OFS7RUN.mjs → chunk-NVEJJP4R.mjs} +1 -1
- package/dist/browser/{chunk-U77XQJOY.mjs → chunk-ODQP7P3H.mjs} +455 -66
- package/dist/browser/{chunk-IFGTRRPU.mjs → chunk-PIS7ZAP7.mjs} +3 -25
- package/dist/browser/{chunk-XIHLIMFX.mjs → chunk-QMNZFFD3.mjs} +4 -3
- package/dist/browser/{chunk-AOKLYVTT.mjs → chunk-SRL47USS.mjs} +2 -2
- package/dist/browser/chunk-TY7L6OXO.mjs +69 -0
- package/dist/browser/{chunk-LGJ6XMH5.mjs → chunk-W643QV3L.mjs} +6 -5
- package/dist/browser/chunk-WXLBZJMT.mjs +25 -0
- package/dist/browser/{chunk-ZKVDQ5ZH.mjs → chunk-XILIT5MT.mjs} +8 -8
- package/dist/browser/{cold-module-Y2IJAP7S.mjs → cold-module-A5S6JFDN.mjs} +20 -20
- package/dist/browser/{durability-wiring-MLXZ5QQF.mjs → durability-wiring-W5AVV3RF.mjs} +53 -30
- package/dist/browser/gzip-5S7ROJFJ.mjs +1 -0
- package/dist/browser/import-PTT63AGK.mjs +12 -0
- package/dist/browser/{module-5LMDGXQH.mjs → module-CEKA7MQH.mjs} +13 -10
- package/dist/browser/module-X5PGOE47.mjs +4288 -0
- package/dist/browser/{phrase-module-KXNRTWCS.mjs → phrase-module-CNKMUY4U.mjs} +2 -1
- package/dist/browser/pool-DTYSPBMQ.mjs +296 -0
- package/dist/{restore-queue-UAVGBSJG.mjs → browser/restore-queue-DD4LWZK7.mjs} +2 -2
- package/dist/browser/{runtime-ZNEGK33G.mjs → runtime-D2ULZGCN.mjs} +3 -2
- package/dist/browser/{snapshot-2EGS2FYU.mjs → snapshot-DQ6A4PQP.mjs} +18 -14
- package/dist/browser/{write-WMZA6NSF.mjs → write-MAGRAIEH.mjs} +14 -11
- package/dist/{capabilities-CNnzGtqP.d.ts → capabilities-BT-HLDC8.d.ts} +2 -2
- package/dist/{chunk-FRJ5RGX7.mjs → chunk-2HJWQPR6.mjs} +2 -2
- package/dist/{chunk-DKMZ7JFW.mjs → chunk-3BVGJ4JR.mjs} +10 -4
- package/dist/{chunk-QYMAYU7M.mjs → chunk-3HV7M5OJ.mjs} +155 -149
- package/dist/chunk-3MXV3VHR.mjs +46 -0
- package/dist/{chunk-6FOJKNUR.mjs → chunk-3SBJVQLL.mjs} +2 -2
- package/dist/{chunk-PRID7CA6.mjs → chunk-3TVDTACC.mjs} +1 -1
- package/dist/{chunk-RTVAWNUL.mjs → chunk-5WB2A3XU.mjs} +9 -6
- package/dist/{chunk-LWFK3TC2.mjs → chunk-65WCV5JO.mjs} +1 -1
- package/dist/{chunk-G6Q5DEF5.mjs → chunk-6BWLDLS3.mjs} +3 -46
- package/dist/{chunk-W6M4RRAT.mjs → chunk-6C5EX2QR.mjs} +3 -3
- package/dist/{chunk-HOC5JP2H.mjs → chunk-6F6USYII.mjs} +119 -11
- package/dist/{chunk-7523VCM4.mjs → chunk-7HKWO4BJ.mjs} +7 -7
- package/dist/{chunk-ONDEEBTA.mjs → chunk-7N223GWV.mjs} +2 -2
- package/dist/{chunk-UGQULMSU.mjs → chunk-ADBS5XRI.mjs} +10 -10
- package/dist/{chunk-MJTEU2XK.mjs → chunk-AWNHDBKV.mjs} +429 -73
- package/dist/{chunk-2E2ZFOPT.mjs → chunk-B2FTZNNF.mjs} +2 -2
- package/dist/{chunk-NWTEJ2T7.mjs → chunk-B7XIOAMK.mjs} +3 -3
- package/dist/{chunk-W55X2BYN.mjs → chunk-BEZH7VEH.mjs} +1 -1
- package/dist/chunk-BTPGQC6Z.mjs +27 -0
- package/dist/{chunk-KG5N7LE6.mjs → chunk-CYYSZPVV.mjs} +11 -11
- package/dist/{chunk-HTMUGEFU.mjs → chunk-DOY6EG76.mjs} +6 -6
- package/dist/{chunk-UHVTEVF5.mjs → chunk-F22IOCR2.mjs} +10 -6
- package/dist/{chunk-FTQLF5JI.mjs → chunk-IRWP524D.mjs} +1 -1
- package/dist/{chunk-XLAI4OIO.mjs → chunk-IZT3G24Q.mjs} +2 -2
- package/dist/{chunk-SE7MKJVK.mjs → chunk-J7M73VY7.mjs} +1 -1
- package/dist/chunk-KAKQ74LS.mjs +53 -0
- package/dist/{chunk-GVPYMSLO.mjs → chunk-KYVRZAYP.mjs} +1 -1
- package/dist/{chunk-F442VZUL.mjs → chunk-KZ5GQE4Z.mjs} +5 -5
- package/dist/{chunk-WDEWU46C.mjs → chunk-KZQIVGW7.mjs} +2 -2
- package/dist/{chunk-7AJAW6NN.mjs → chunk-L7TIAYPX.mjs} +8 -8
- package/dist/{chunk-GRFXSEFF.mjs → chunk-LDGGR7YT.mjs} +4 -81
- package/dist/{chunk-WMIV7PJ7.mjs → chunk-LJ4ENXOD.mjs} +15 -14
- package/dist/chunk-LQG5G2LY.mjs +39 -0
- package/dist/{chunk-IQHZMCLX.mjs → chunk-MDF6PDIA.mjs} +2 -0
- package/dist/{chunk-QXH2CS4V.mjs → chunk-NVTFQFUL.mjs} +7 -26
- package/dist/{chunk-5K2JHKM3.mjs → chunk-NYSONUB7.mjs} +1 -1
- package/dist/{chunk-OH7SX5MY.mjs → chunk-O4KUNDVF.mjs} +12 -10
- package/dist/{chunk-EBIHRL7B.mjs → chunk-Q2UL2TPC.mjs} +1 -1
- package/dist/{chunk-RNUP6WZ6.mjs → chunk-QEYF2SQ6.mjs} +2 -2
- package/dist/{chunk-RVBUQITB.mjs → chunk-QN5WVV5K.mjs} +7 -7
- package/dist/{chunk-RIIUZJQ3.mjs → chunk-QYRNLLLI.mjs} +1 -1
- package/dist/{chunk-BTARFTEN.mjs → chunk-SOUZMPME.mjs} +4 -4
- package/dist/{chunk-ISUOSACK.mjs → chunk-T4CJDBBE.mjs} +1 -1
- package/dist/{chunk-DHEJAGVW.mjs → chunk-TTCKT2RT.mjs} +5 -5
- package/dist/{chunk-QU2XF7VI.mjs → chunk-U2726TL5.mjs} +5 -4
- package/dist/{chunk-LYKUJNAV.mjs → chunk-U46IZNCW.mjs} +2 -2
- package/dist/{chunk-SNB4DYL3.mjs → chunk-U6NE6RCV.mjs} +4 -4
- package/dist/{chunk-SA52N7G3.mjs → chunk-VP6XRMWR.mjs} +4 -4
- package/dist/{chunk-YUCGFPMS.mjs → chunk-VQDZVWN3.mjs} +449 -405
- package/dist/{chunk-IWVEG5CX.mjs → chunk-XIHUI4KB.mjs} +2 -2
- package/dist/{chunk-IV2XTSS2.mjs → chunk-XKPNKR3V.mjs} +16 -46
- package/dist/{chunk-UQS5PAS5.mjs → chunk-YGQOPB2Z.mjs} +1 -1
- package/dist/{chunk-SVO6NV4D.mjs → chunk-YKEHQUSZ.mjs} +4 -4
- package/dist/{chunk-6Z22L5RN.mjs → chunk-ZAYWOHVG.mjs} +1 -1
- package/dist/{chunk-QLDLQW36.mjs → chunk-ZEKDO7YX.mjs} +2 -2
- package/dist/chunk-ZXNNR73R.mjs +31 -0
- package/dist/{chunk-VJS4JFBQ.mjs → chunk-ZXX5GZEX.mjs} +3 -1
- package/dist/{chunk-X5SBWARI.mjs → chunk-ZYKUD5NX.mjs} +9 -7
- package/dist/{client-DoYPHcUn.d.ts → client-Cn3gNxUU.d.ts} +3 -3
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +2 -0
- package/dist/{cold-module-NUD332YD.mjs → cold-module-2WWGBFJC.mjs} +36 -33
- package/dist/{config-CuUfls_H.d.ts → config-CfhH1IWQ.d.ts} +1 -1
- package/dist/{config-Dzs46im6.d.ts → config-aIsy7mcL.d.ts} +52 -1
- package/dist/direct-executor-QLVHMELJ.mjs +24 -0
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +4 -4
- package/dist/distribution.mjs +150 -255
- package/dist/{durability-wiring-K7RDXWL6.mjs → durability-wiring-GNWQSZI3.mjs} +67 -42
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-C0ifUEcm.d.ts → engine-CJRUHXgf.d.ts} +1 -1
- package/dist/gzip-F4HMIEEQ.mjs +1 -0
- package/dist/import-DX55PN4G.mjs +41 -0
- package/dist/index.browser.mjs +7 -4
- package/dist/index.d.ts +539 -5
- package/dist/index.mjs +22 -16
- package/dist/index.react-native.mjs +19 -0
- package/dist/{long-query-thread-FKVHRCHF.mjs → long-query-thread-SCUE62TO.mjs} +20 -17
- package/dist/{module-GJUKW5VU.mjs → module-HW6IXUM6.mjs} +601 -108
- package/dist/{module-TMFIWOD2.mjs → module-V5K4ZP23.mjs} +29 -23
- package/dist/{paged-partition-archive-WNUEMYWM.mjs → paged-partition-archive-FDIIWZNR.mjs} +31 -25
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.mjs +28 -22
- package/dist/{phrase-module-OMY3QQV7.mjs → phrase-module-OUQIRUQU.mjs} +1 -1
- package/dist/pool-UPV5PVPY.mjs +298 -0
- package/dist/react-native/chunks/analysis-change-HGW3L6NY.mjs +893 -0
- package/dist/react-native/chunks/analysis-change-entry-BNRU6STO.mjs +1 -0
- package/dist/react-native/chunks/chunk-2J2727V4.mjs +495 -0
- package/dist/react-native/chunks/chunk-3CTWSQRW.mjs +1251 -0
- package/dist/react-native/chunks/chunk-5FV4ZEVA.mjs +2619 -0
- package/dist/react-native/chunks/chunk-7VWQLEFV.mjs +642 -0
- package/dist/react-native/chunks/chunk-AAAETEJK.mjs +27 -0
- package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +32 -0
- package/dist/react-native/chunks/chunk-B6OD63Z3.mjs +997 -0
- package/dist/react-native/chunks/chunk-BRNAVOKP.mjs +177 -0
- package/dist/react-native/chunks/chunk-DKJTZ625.mjs +207 -0
- package/dist/react-native/chunks/chunk-FKGG4UOF.mjs +177 -0
- package/dist/{browser/chunk-K7UFXEJS.mjs → react-native/chunks/chunk-GV5KFQ6M.mjs} +12 -6
- package/dist/react-native/chunks/chunk-HURV3ASY.mjs +4416 -0
- package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +10 -0
- package/dist/react-native/chunks/chunk-JV6VQY2S.mjs +17 -0
- package/dist/react-native/chunks/chunk-KUJOBRKS.mjs +217 -0
- package/dist/react-native/chunks/chunk-KWRW5U65.mjs +226 -0
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +110 -0
- package/dist/react-native/chunks/chunk-LQ6Q4L5B.mjs +360 -0
- package/dist/react-native/chunks/chunk-LQAKO5QV.mjs +523 -0
- package/dist/react-native/chunks/chunk-LRGWK367.mjs +11 -0
- package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +93 -0
- package/dist/react-native/chunks/chunk-NFGBOI46.mjs +14 -0
- package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +8 -0
- package/dist/react-native/chunks/chunk-PPEPTUVV.mjs +56 -0
- package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +9 -0
- package/dist/react-native/chunks/chunk-PU55IOG4.mjs +910 -0
- package/dist/react-native/chunks/chunk-QC4ZRBSX.mjs +270 -0
- package/dist/react-native/chunks/chunk-R4EEMYM6.mjs +21 -0
- package/dist/react-native/chunks/chunk-R4OPUZQ5.mjs +86 -0
- package/dist/react-native/chunks/chunk-SLGIAD6B.mjs +2634 -0
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +25 -0
- package/dist/react-native/chunks/chunk-TLYD7IJ2.mjs +23 -0
- package/dist/react-native/chunks/chunk-UFNCLEQM.mjs +73 -0
- package/dist/react-native/chunks/chunk-YH7W556M.mjs +179 -0
- package/dist/react-native/chunks/chunk-YJSMEKRE.mjs +22385 -0
- package/dist/react-native/chunks/chunk-ZCKNBPQ4.mjs +79 -0
- package/dist/react-native/chunks/cold-module-TSFWLYWC.mjs +755 -0
- package/dist/react-native/chunks/durability-wiring-PZR6KOQK.mjs +4509 -0
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +3 -0
- package/dist/react-native/chunks/import-VTODLPLO.mjs +22 -0
- package/dist/{browser/module-Q6VFGLMG.mjs → react-native/chunks/module-JBBH6PZH.mjs} +609 -144
- package/dist/react-native/chunks/module-VEK2KCKU.mjs +25 -0
- package/dist/react-native/chunks/phrase-module-76UAPPSG.mjs +329 -0
- package/dist/react-native/chunks/pool-CD4ANYUI.mjs +296 -0
- package/dist/react-native/chunks/release-D7ZTIANM.mjs +33 -0
- package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
- package/dist/{browser/restore-queue-SOAHKZSQ.mjs → react-native/chunks/restore-queue-OI5EH7R3.mjs} +2 -2
- package/dist/react-native/chunks/runtime-3MCDLJAF.mjs +559 -0
- package/dist/react-native/chunks/snapshot-AUZMEV36.mjs +1205 -0
- package/dist/react-native/chunks/write-DDC2QBRJ.mjs +197 -0
- package/dist/react-native/partial-words.mjs +733 -0
- package/dist/react-native/pattern.mjs +2442 -0
- package/dist/react-native/synonyms.mjs +460 -0
- package/dist/react.d.ts +7 -7
- package/dist/react.mjs +2 -0
- package/dist/{rerank-ZZ5CHKLW.mjs → rerank-3W54N6P2.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-queue-BQWWNNQI.mjs +41 -0
- package/dist/{runtime-RAOCKSYA.mjs → runtime-L2DZYY6N.mjs} +5 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +32 -28
- package/dist/{snapshot-DB5ZVCDN.mjs → snapshot-EHXTOTW5.mjs} +39 -33
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-ChWp0wrF.d.ts → tasks-C4ElXr4P.d.ts} +2 -2
- package/dist/thread-I7DVHHW7.mjs +31 -0
- package/dist/vector/search-worker.mjs +7 -5
- package/dist/workers/entry.mjs +9 -9
- package/dist/{write-KZVTLGCI.mjs → write-SDJXXQ2G.mjs} +29 -23
- package/package.json +88 -7
- package/dist/analysis-change-D5APH4Z3.mjs +0 -34
- package/dist/browser/import-FTMLTPGQ.mjs +0 -9
- package/dist/direct-executor-FDQYQEJQ.mjs +0 -22
- package/dist/import-6KXFY6XI.mjs +0 -35
- package/dist/thread-OV6T555H.mjs +0 -28
- /package/dist/{chunk-22YPZVMG.mjs → chunk-ZXNQEW43.mjs} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { youngGenerationBytesOfThisV8 } from './chunk-
|
|
2
|
-
import { PROCESS_LIMIT_REFRESH_INTERVAL_MS } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { youngGenerationBytesOfThisV8 } from './chunk-Q2UL2TPC.mjs';
|
|
2
|
+
import { PROCESS_LIMIT_REFRESH_INTERVAL_MS } from './chunk-ZXNQEW43.mjs';
|
|
3
|
+
import { turnIsSpent, yieldTurn, createDocIdMap } from './chunk-LQG5G2LY.mjs';
|
|
4
|
+
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, FILTER_OPERAND_COPY_DEPTH, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-U46IZNCW.mjs';
|
|
4
5
|
import { bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet } from './chunk-JUKYYXSP.mjs';
|
|
5
|
-
import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, expandTermPrefix, flattenSchema, suggestDisplayTerms, getNestedValue, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, getOrCreateFieldNameIndex, partitionDocumentFrequency, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-
|
|
6
|
+
import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, expandTermPrefix, flattenSchema, suggestDisplayTerms, getNestedValue, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, getOrCreateFieldNameIndex, partitionDocumentFrequency, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-SOUZMPME.mjs';
|
|
6
7
|
import { MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_PAGE_SIZE, PREFIX_MAX_EXPANSIONS } from './chunk-FQBFZAWG.mjs';
|
|
7
|
-
import { tokenize, visitTokens } from './chunk-
|
|
8
|
+
import { tokenize, visitTokens } from './chunk-65WCV5JO.mjs';
|
|
8
9
|
import { TARGET_BLOCK_ENTRIES, SCORE_BUFFER_INITIAL_TOUCHED_CAPACITY, PRUNING_REJECTION_SLACK, SORT_COLUMN_MINIMUM_REBUILD_THRESHOLD, SORT_COLUMN_REBUILD_FRACTION_SHIFT } from './chunk-4UMZ7KQL.mjs';
|
|
9
|
-
import { parsedTypeOf, isStringValuedBase, withSortableOption, fuzzyPrefixOf, boundedLevenshtein, isWordIndexedBase, isWordIndexedFieldType, fuzzyTermMatches, isListBase } from './chunk-
|
|
10
|
+
import { parsedTypeOf, isStringValuedBase, withSortableOption, fuzzyPrefixOf, boundedLevenshtein, isWordIndexedBase, isWordIndexedFieldType, fuzzyTermMatches, isListBase } from './chunk-KYVRZAYP.mjs';
|
|
10
11
|
import { isGeopointOrVectorType, PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
|
|
11
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
12
|
+
import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
|
|
12
13
|
import { singleFoldTable, appendFoldedCodePoint, sortModeOf, defaultSortMode, SORT_VALUE_MAX_CODE_POINTS, toReducedSortValue, readSortField, compareComparableKeys, toComparableSortValue, isSortMode, SORT_MODES, compareSortValues, compareComparableValues, truncateSortString } from './chunk-R6A773WK.mjs';
|
|
13
14
|
import { compareCodePoints, exceedsCodePoints, codePointCount, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
|
|
14
15
|
import { totalmem, freemem } from 'os';
|
|
@@ -167,17 +168,6 @@ function requirePatternSearch(fieldPath) {
|
|
|
167
168
|
{ field: fieldPath }
|
|
168
169
|
);
|
|
169
170
|
}
|
|
170
|
-
|
|
171
|
-
// src/core/constants.ts
|
|
172
|
-
var POSTING_LIST_COMPACTION_THRESHOLD = 0.3;
|
|
173
|
-
var MAX_TERM_FREQUENCY = 65535;
|
|
174
|
-
var ARRAY_POSITION_GAP = 100;
|
|
175
|
-
var DEFAULT_BM25_K1 = 1.2;
|
|
176
|
-
var DEFAULT_BM25_B = 0.75;
|
|
177
|
-
var MAX_BM25_K1 = 1e3;
|
|
178
|
-
var MAX_BM25_B = 1;
|
|
179
|
-
var PENDING_REMOVAL_MERGE_FLOOR = 64;
|
|
180
|
-
var PENDING_REMOVAL_MERGE_DIVISOR = 256;
|
|
181
171
|
var MEGABYTE_BYTES = 1048576;
|
|
182
172
|
var IN_MEGABYTES = /^--max-old-space-size=(\d+)$/;
|
|
183
173
|
var AS_PERCENTAGE = /^--max-old-space-size-percentage=(\d+(?:\.\d+)?)$/;
|
|
@@ -186,7 +176,7 @@ var YOUNG_GENERATION_SPACES = /* @__PURE__ */ new Set(["new_space", "new_large_o
|
|
|
186
176
|
var V8_YOUNG_GENERATION_BYTES_PER_SEMI_SPACE_BYTE = 3;
|
|
187
177
|
function flagEntries() {
|
|
188
178
|
const fromNodeOptions = (process.env.NODE_OPTIONS ?? "").split(/\s+/).filter((entry) => entry.length > 0);
|
|
189
|
-
return [...process.execArgv
|
|
179
|
+
return [...fromNodeOptions, ...process.execArgv];
|
|
190
180
|
}
|
|
191
181
|
function memoryTheHostAllows() {
|
|
192
182
|
const constrained = process.constrainedMemory?.() ?? 0;
|
|
@@ -303,6 +293,17 @@ function readHeapStatistics() {
|
|
|
303
293
|
}
|
|
304
294
|
}
|
|
305
295
|
|
|
296
|
+
// src/core/constants.ts
|
|
297
|
+
var POSTING_LIST_COMPACTION_THRESHOLD = 0.3;
|
|
298
|
+
var MAX_TERM_FREQUENCY = 65535;
|
|
299
|
+
var ARRAY_POSITION_GAP = 100;
|
|
300
|
+
var DEFAULT_BM25_K1 = 1.2;
|
|
301
|
+
var DEFAULT_BM25_B = 0.75;
|
|
302
|
+
var MAX_BM25_K1 = 1e3;
|
|
303
|
+
var MAX_BM25_B = 1;
|
|
304
|
+
var PENDING_REMOVAL_MERGE_FLOOR = 64;
|
|
305
|
+
var PENDING_REMOVAL_MERGE_DIVISOR = 256;
|
|
306
|
+
|
|
306
307
|
// src/core/partition/frozen/memory.ts
|
|
307
308
|
function frozenSegmentBytes(segment) {
|
|
308
309
|
if (segment.paged !== null) return segment.paged.heldBytes(segment);
|
|
@@ -581,25 +582,40 @@ function documentValueBytes(value) {
|
|
|
581
582
|
return PRIMITIVE_SLOT_BYTES;
|
|
582
583
|
}
|
|
583
584
|
function createDocumentStore() {
|
|
584
|
-
const
|
|
585
|
-
const
|
|
585
|
+
const internalIds = createDocIdMap();
|
|
586
|
+
const storedById = [];
|
|
586
587
|
const reverseMap = [];
|
|
587
588
|
const lengthColumns = /* @__PURE__ */ new Map();
|
|
588
589
|
let nextInternalId = 0;
|
|
589
590
|
let numberingResets = 0;
|
|
590
591
|
let sortedIds = null;
|
|
591
592
|
let storedContentBytes = 0;
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
593
|
+
let storedCount = 0;
|
|
594
|
+
let newestNumberedDocId;
|
|
595
|
+
function storedOf(docId) {
|
|
596
|
+
const internalId = internalIds.get(docId);
|
|
597
|
+
return internalId === void 0 ? void 0 : storedById[internalId];
|
|
598
|
+
}
|
|
599
|
+
function putStored(docId, internalId, stored) {
|
|
600
|
+
if (storedById[internalId] === void 0) {
|
|
601
|
+
storedCount++;
|
|
597
602
|
sortedIds = null;
|
|
603
|
+
if (docId !== newestNumberedDocId) {
|
|
604
|
+
internalIds.delete(docId);
|
|
605
|
+
internalIds.set(docId, internalId);
|
|
606
|
+
newestNumberedDocId = docId;
|
|
607
|
+
}
|
|
598
608
|
}
|
|
599
|
-
|
|
609
|
+
storedById[internalId] = stored;
|
|
610
|
+
}
|
|
611
|
+
function replaceStored(docId, document, fieldLengths) {
|
|
612
|
+
const internalId = assignInternalId(docId);
|
|
613
|
+
const existing = storedById[internalId];
|
|
614
|
+
if (existing !== void 0) storedContentBytes -= documentValueBytes(existing.fields);
|
|
615
|
+
writeFieldLengths(internalId, fieldLengths);
|
|
600
616
|
const fields = documentWithOwnBuffers(document);
|
|
601
617
|
storedContentBytes += documentValueBytes(fields);
|
|
602
|
-
|
|
618
|
+
putStored(docId, internalId, { fields, fieldLengths });
|
|
603
619
|
}
|
|
604
620
|
function writeFieldLengths(internalId, fieldLengths) {
|
|
605
621
|
for (const fieldName of Object.keys(fieldLengths)) {
|
|
@@ -614,26 +630,36 @@ function createDocumentStore() {
|
|
|
614
630
|
}
|
|
615
631
|
}
|
|
616
632
|
function assignInternalId(docId) {
|
|
617
|
-
const existing =
|
|
633
|
+
const existing = internalIds.get(docId);
|
|
618
634
|
if (existing !== void 0) return existing;
|
|
619
635
|
const internalId = nextInternalId++;
|
|
620
|
-
|
|
636
|
+
internalIds.set(docId, internalId);
|
|
637
|
+
newestNumberedDocId = docId;
|
|
621
638
|
reverseMap[internalId] = docId;
|
|
622
639
|
return internalId;
|
|
623
640
|
}
|
|
624
641
|
function clearMappings() {
|
|
625
|
-
|
|
642
|
+
internalIds.clear();
|
|
643
|
+
storedById.length = 0;
|
|
626
644
|
reverseMap.length = 0;
|
|
627
645
|
nextInternalId = 0;
|
|
646
|
+
storedCount = 0;
|
|
647
|
+
newestNumberedDocId = void 0;
|
|
628
648
|
numberingResets++;
|
|
629
649
|
sortedIds = null;
|
|
630
650
|
}
|
|
651
|
+
function* storedEntries() {
|
|
652
|
+
for (const [docId, internalId] of internalIds) {
|
|
653
|
+
const stored = storedById[internalId];
|
|
654
|
+
if (stored !== void 0) yield [docId, stored];
|
|
655
|
+
}
|
|
656
|
+
}
|
|
631
657
|
const idResolver = {
|
|
632
658
|
toExternal(internalId) {
|
|
633
659
|
return reverseMap[internalId];
|
|
634
660
|
},
|
|
635
661
|
toInternal(externalId) {
|
|
636
|
-
return
|
|
662
|
+
return internalIds.get(externalId);
|
|
637
663
|
},
|
|
638
664
|
isLive(internalId) {
|
|
639
665
|
return reverseMap[internalId] !== void 0;
|
|
@@ -647,39 +673,36 @@ function createDocumentStore() {
|
|
|
647
673
|
replaceStored(docId, document, fieldLengths);
|
|
648
674
|
},
|
|
649
675
|
get(docId) {
|
|
650
|
-
return
|
|
676
|
+
return storedOf(docId);
|
|
651
677
|
},
|
|
652
678
|
remove(docId) {
|
|
653
|
-
const
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
for (const column of lengthColumns.values()) {
|
|
665
|
-
if (internalId < column.length) column[internalId] = 0;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
679
|
+
const internalId = internalIds.get(docId);
|
|
680
|
+
const existing = internalId === void 0 ? void 0 : storedById[internalId];
|
|
681
|
+
if (internalId === void 0 || existing === void 0) return false;
|
|
682
|
+
storedContentBytes -= documentValueBytes(existing.fields);
|
|
683
|
+
sortedIds = null;
|
|
684
|
+
storedCount--;
|
|
685
|
+
internalIds.delete(docId);
|
|
686
|
+
storedById[internalId] = void 0;
|
|
687
|
+
reverseMap[internalId] = void 0;
|
|
688
|
+
for (const column of lengthColumns.values()) {
|
|
689
|
+
if (internalId < column.length) column[internalId] = 0;
|
|
668
690
|
}
|
|
669
|
-
return
|
|
691
|
+
return true;
|
|
670
692
|
},
|
|
671
693
|
has(docId) {
|
|
672
|
-
return
|
|
694
|
+
return storedOf(docId) !== void 0;
|
|
673
695
|
},
|
|
674
696
|
count() {
|
|
675
|
-
return
|
|
697
|
+
return storedCount;
|
|
676
698
|
},
|
|
677
699
|
all() {
|
|
678
|
-
return
|
|
700
|
+
return storedEntries();
|
|
679
701
|
},
|
|
680
702
|
sortedDocIds() {
|
|
681
703
|
if (sortedIds === null) {
|
|
682
|
-
const ids =
|
|
704
|
+
const ids = [];
|
|
705
|
+
for (const [docId] of storedEntries()) ids.push(docId);
|
|
683
706
|
ids.sort(compareCodePoints);
|
|
684
707
|
sortedIds = ids;
|
|
685
708
|
}
|
|
@@ -689,29 +712,28 @@ function createDocumentStore() {
|
|
|
689
712
|
sortedIds = null;
|
|
690
713
|
},
|
|
691
714
|
clear() {
|
|
692
|
-
docs.clear();
|
|
693
715
|
lengthColumns.clear();
|
|
694
716
|
clearMappings();
|
|
695
717
|
storedContentBytes = 0;
|
|
696
718
|
},
|
|
697
719
|
serialize() {
|
|
698
720
|
const result = {};
|
|
699
|
-
for (const [docId, stored] of
|
|
721
|
+
for (const [docId, stored] of storedEntries()) {
|
|
700
722
|
result[docId] = stored;
|
|
701
723
|
}
|
|
702
724
|
return result;
|
|
703
725
|
},
|
|
704
726
|
deserialize(data) {
|
|
705
|
-
docs.clear();
|
|
706
727
|
lengthColumns.clear();
|
|
707
728
|
clearMappings();
|
|
708
729
|
storedContentBytes = 0;
|
|
709
730
|
for (const docId of Object.keys(data)) {
|
|
710
731
|
const stored = data[docId];
|
|
711
|
-
|
|
732
|
+
const internalId = assignInternalId(docId);
|
|
733
|
+
writeFieldLengths(internalId, stored.fieldLengths);
|
|
712
734
|
const fields = documentWithOwnBuffers(stored.fields);
|
|
713
735
|
storedContentBytes += documentValueBytes(fields);
|
|
714
|
-
|
|
736
|
+
putStored(docId, internalId, fields === stored.fields ? stored : { fields, fieldLengths: stored.fieldLengths });
|
|
715
737
|
}
|
|
716
738
|
},
|
|
717
739
|
fieldLengthColumn(fieldName) {
|
|
@@ -721,14 +743,14 @@ function createDocumentStore() {
|
|
|
721
743
|
return assignInternalId(docId);
|
|
722
744
|
},
|
|
723
745
|
getInternalId(docId) {
|
|
724
|
-
return
|
|
746
|
+
return internalIds.get(docId);
|
|
725
747
|
},
|
|
726
748
|
getExternalId(internalId) {
|
|
727
749
|
return reverseMap[internalId];
|
|
728
750
|
},
|
|
729
751
|
*allInternalIds() {
|
|
730
|
-
for (
|
|
731
|
-
yield internalId;
|
|
752
|
+
for (let internalId = 0; internalId < reverseMap.length; internalId++) {
|
|
753
|
+
if (reverseMap[internalId] !== void 0) yield internalId;
|
|
732
754
|
}
|
|
733
755
|
},
|
|
734
756
|
internalIdCapacity() {
|
|
@@ -745,13 +767,12 @@ function createDocumentStore() {
|
|
|
745
767
|
},
|
|
746
768
|
fieldReader(fieldPath) {
|
|
747
769
|
return (internalId) => {
|
|
748
|
-
const
|
|
749
|
-
const stored = docId === void 0 ? void 0 : docs.get(docId);
|
|
770
|
+
const stored = storedById[internalId];
|
|
750
771
|
return stored === void 0 ? void 0 : getNestedValue(stored.fields, fieldPath);
|
|
751
772
|
};
|
|
752
773
|
},
|
|
753
774
|
projectedDocument(docId, projection) {
|
|
754
|
-
const stored =
|
|
775
|
+
const stored = storedOf(docId);
|
|
755
776
|
return stored === void 0 ? void 0 : cloneProjected(stored.fields, projection);
|
|
756
777
|
}
|
|
757
778
|
};
|
|
@@ -2023,6 +2044,14 @@ function countFieldValues(state, fieldPath, fieldType, bitset, matched) {
|
|
|
2023
2044
|
}
|
|
2024
2045
|
return countValuesFromDocuments(state, fieldPath, matched);
|
|
2025
2046
|
}
|
|
2047
|
+
function sortFacetedNumbers(state, config, schema) {
|
|
2048
|
+
const flatSchema = getFlatSchema(state, schema);
|
|
2049
|
+
for (const fieldPath of Object.keys(config)) {
|
|
2050
|
+
const fieldType = flatSchema[fieldPath];
|
|
2051
|
+
if (fieldType !== "number" && fieldType !== "number[]") continue;
|
|
2052
|
+
state.numericIndexes.get(fieldPath)?.sortPending();
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2026
2055
|
function computeFacets(state, matched, config, schema) {
|
|
2027
2056
|
const result = {};
|
|
2028
2057
|
const flatSchema = getFlatSchema(state, schema);
|
|
@@ -3017,6 +3046,7 @@ function createNumericIndex() {
|
|
|
3017
3046
|
}
|
|
3018
3047
|
return seen.size;
|
|
3019
3048
|
},
|
|
3049
|
+
sortPending: ensureSorted,
|
|
3020
3050
|
clear() {
|
|
3021
3051
|
entries = [];
|
|
3022
3052
|
discardPending();
|
|
@@ -4733,6 +4763,13 @@ function textRangeBitsetOf(state, fieldPath, fieldType, bounds, capacity) {
|
|
|
4733
4763
|
const resolver = state.docStore.resolver();
|
|
4734
4764
|
return selectTextRange(column, bounds, capacity, (internalId) => resolver.isLive(internalId));
|
|
4735
4765
|
}
|
|
4766
|
+
function prepareSortColumnsOf(state, request) {
|
|
4767
|
+
const set = ensureColumns(state);
|
|
4768
|
+
const { fields, directions, fieldTypes, modes } = request;
|
|
4769
|
+
for (let index = 0; index < fields.length; index++) {
|
|
4770
|
+
set.column(fields[index], fieldTypes[index], modes[index] ?? defaultSortMode(directions[index] ?? "asc"));
|
|
4771
|
+
}
|
|
4772
|
+
}
|
|
4736
4773
|
function sortedPageOf(state, request) {
|
|
4737
4774
|
ensureColumns(state);
|
|
4738
4775
|
return selectSortedPage(state, request);
|
|
@@ -4768,6 +4805,22 @@ function refreshSortColumns(state) {
|
|
|
4768
4805
|
function sortColumnBytes(state) {
|
|
4769
4806
|
return state.sortColumns === null ? 0 : state.sortColumns.estimateBytes();
|
|
4770
4807
|
}
|
|
4808
|
+
function sortedReadsOf(state) {
|
|
4809
|
+
return {
|
|
4810
|
+
prepareSortedPage(request) {
|
|
4811
|
+
prepareSortColumnsOf(state, request);
|
|
4812
|
+
},
|
|
4813
|
+
prepareFacets(config, schema) {
|
|
4814
|
+
sortFacetedNumbers(state, config, schema);
|
|
4815
|
+
},
|
|
4816
|
+
sortedPage(request) {
|
|
4817
|
+
return sortedPageOf(state, request);
|
|
4818
|
+
},
|
|
4819
|
+
sortValues(docId, fields, fieldTypes, modes) {
|
|
4820
|
+
return sortValuesOf(state, docId, fields, fieldTypes, modes);
|
|
4821
|
+
}
|
|
4822
|
+
};
|
|
4823
|
+
}
|
|
4771
4824
|
|
|
4772
4825
|
// src/core/partition/filters.ts
|
|
4773
4826
|
function presentBitsetOf(state, fieldPath, type, capacity) {
|
|
@@ -4920,7 +4973,7 @@ function requireLoadedPhraseCode() {
|
|
|
4920
4973
|
}
|
|
4921
4974
|
function loadPhraseCode() {
|
|
4922
4975
|
if (loading === null) {
|
|
4923
|
-
loading = import('./phrase-module-
|
|
4976
|
+
loading = import('./phrase-module-OUQIRUQU.mjs').then(
|
|
4924
4977
|
(code) => {
|
|
4925
4978
|
loaded = code;
|
|
4926
4979
|
return code;
|
|
@@ -7129,12 +7182,7 @@ function createPartitionIndex(partitionId, trackPositions = true) {
|
|
|
7129
7182
|
searchFulltextMatches(params) {
|
|
7130
7183
|
return searchFulltextMatches(state, params);
|
|
7131
7184
|
},
|
|
7132
|
-
|
|
7133
|
-
return sortedPageOf(state, request);
|
|
7134
|
-
},
|
|
7135
|
-
sortValues(docId, fields, fieldTypes, modes) {
|
|
7136
|
-
return sortValuesOf(state, docId, fields, fieldTypes, modes);
|
|
7137
|
-
},
|
|
7185
|
+
...sortedReadsOf(state),
|
|
7138
7186
|
applyFilters(filters, schema, meter) {
|
|
7139
7187
|
return applyPartitionFilters(state, filters, schema, meter);
|
|
7140
7188
|
},
|
|
@@ -7747,6 +7795,9 @@ function compositeSortedPage(subs, layout, request) {
|
|
|
7747
7795
|
if (merged.length > request.limit) merged.length = request.limit;
|
|
7748
7796
|
return merged;
|
|
7749
7797
|
}
|
|
7798
|
+
function prepareCompositeSortColumns(subs, request) {
|
|
7799
|
+
for (const sub of subs) prepareSortColumnsOf(sub, request);
|
|
7800
|
+
}
|
|
7750
7801
|
function compositeSortValues(subs, docId, fields, fieldTypes, modes) {
|
|
7751
7802
|
for (const sub of subs) {
|
|
7752
7803
|
if (sub.docStore.has(docId)) {
|
|
@@ -7983,6 +8034,12 @@ function createCompositePartition(partitionId, trackPositions = true, existingLi
|
|
|
7983
8034
|
computeFacets(matched, config, schema) {
|
|
7984
8035
|
return compositeFacets(subs(), layout, matched, config, schema);
|
|
7985
8036
|
},
|
|
8037
|
+
prepareSortedPage(request) {
|
|
8038
|
+
prepareCompositeSortColumns(subs(), request);
|
|
8039
|
+
},
|
|
8040
|
+
prepareFacets(config, schema) {
|
|
8041
|
+
live.prepareFacets(config, schema);
|
|
8042
|
+
},
|
|
7986
8043
|
sortedPage(request) {
|
|
7987
8044
|
return compositeSortedPage(subs(), layout(), request);
|
|
7988
8045
|
},
|
|
@@ -8046,57 +8103,34 @@ function createCompositePartition(partitionId, trackPositions = true, existingLi
|
|
|
8046
8103
|
}
|
|
8047
8104
|
};
|
|
8048
8105
|
}
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
for (let i = 0; i < length; i++) {
|
|
8060
|
-
hash = Math.imul(hash ^ bytes[i], FNV_PRIME);
|
|
8061
|
-
}
|
|
8062
|
-
return hash;
|
|
8063
|
-
}
|
|
8064
|
-
var scratchNumber = new Float64Array(1);
|
|
8065
|
-
var scratchBytes = new Uint8Array(scratchNumber.buffer);
|
|
8066
|
-
var HOST_IS_LITTLE_ENDIAN = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
|
8067
|
-
function fnv1aContinueTaggedNumbers(start, tag, numbers) {
|
|
8068
|
-
let hash = start;
|
|
8069
|
-
const b = scratchBytes;
|
|
8070
|
-
for (let i = 0; i < numbers.length; i++) {
|
|
8071
|
-
scratchNumber[0] = Math.fround(numbers[i]);
|
|
8072
|
-
hash = Math.imul(hash ^ tag, FNV_PRIME);
|
|
8073
|
-
if (HOST_IS_LITTLE_ENDIAN) {
|
|
8074
|
-
hash = Math.imul(hash ^ b[7], FNV_PRIME);
|
|
8075
|
-
hash = Math.imul(hash ^ b[6], FNV_PRIME);
|
|
8076
|
-
hash = Math.imul(hash ^ b[5], FNV_PRIME);
|
|
8077
|
-
hash = Math.imul(hash ^ b[4], FNV_PRIME);
|
|
8078
|
-
hash = Math.imul(hash ^ b[3], FNV_PRIME);
|
|
8079
|
-
hash = Math.imul(hash ^ b[2], FNV_PRIME);
|
|
8080
|
-
hash = Math.imul(hash ^ b[1], FNV_PRIME);
|
|
8081
|
-
hash = Math.imul(hash ^ b[0], FNV_PRIME);
|
|
8082
|
-
} else {
|
|
8083
|
-
for (let at = 0; at < 8; at++) hash = Math.imul(hash ^ b[at], FNV_PRIME);
|
|
8084
|
-
}
|
|
8085
|
-
}
|
|
8086
|
-
return hash;
|
|
8106
|
+
var limitBytes = 0;
|
|
8107
|
+
var limitReadAt = Number.NEGATIVE_INFINITY;
|
|
8108
|
+
function readProcessLimit(residentBytes) {
|
|
8109
|
+
const hostBytes = totalmem();
|
|
8110
|
+
const constrained = typeof process.constrainedMemory === "function" ? process.constrainedMemory() : 0;
|
|
8111
|
+
if (Number.isFinite(constrained) && constrained > 0 && constrained < hostBytes) return constrained;
|
|
8112
|
+
if (process.platform !== "linux") return hostBytes;
|
|
8113
|
+
const availableBytes = freemem();
|
|
8114
|
+
if (!Number.isFinite(availableBytes) || availableBytes < 0) return hostBytes;
|
|
8115
|
+
return Math.min(hostBytes, residentBytes + availableBytes);
|
|
8087
8116
|
}
|
|
8088
|
-
function
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
hash = Math.imul(hash, FNV_PRIME);
|
|
8094
|
-
}
|
|
8117
|
+
function processLimitBytes(residentBytes) {
|
|
8118
|
+
const now = performance.now();
|
|
8119
|
+
if (now - limitReadAt >= PROCESS_LIMIT_REFRESH_INTERVAL_MS) {
|
|
8120
|
+
limitBytes = readProcessLimit(residentBytes);
|
|
8121
|
+
limitReadAt = now;
|
|
8095
8122
|
}
|
|
8096
|
-
return
|
|
8123
|
+
return limitBytes;
|
|
8097
8124
|
}
|
|
8098
|
-
function
|
|
8099
|
-
|
|
8125
|
+
function readResidentMemory() {
|
|
8126
|
+
try {
|
|
8127
|
+
const residentBytes = process.memoryUsage.rss();
|
|
8128
|
+
const limitBytes2 = processLimitBytes(residentBytes);
|
|
8129
|
+
if (!Number.isFinite(residentBytes) || !Number.isFinite(limitBytes2) || limitBytes2 <= 0) return null;
|
|
8130
|
+
return { residentBytes, limitBytes: limitBytes2 };
|
|
8131
|
+
} catch {
|
|
8132
|
+
return null;
|
|
8133
|
+
}
|
|
8100
8134
|
}
|
|
8101
8135
|
|
|
8102
8136
|
// src/partitioning/manager/nested-values.ts
|
|
@@ -9067,6 +9101,7 @@ async function fanOutQuery(manager, params, language, schema, config, searchOpti
|
|
|
9067
9101
|
const partitionFacets = [];
|
|
9068
9102
|
const everyValue = params.facets ? everyValueFacetConfig(params.facets) : void 0;
|
|
9069
9103
|
for (const partition of partitions) {
|
|
9104
|
+
if (turnIsSpent()) await yieldTurn();
|
|
9070
9105
|
options.patternWork?.clock?.check();
|
|
9071
9106
|
const result = dispatchSinglePartition(partition, params, language, schema, options);
|
|
9072
9107
|
if (everyValue) {
|
|
@@ -9141,34 +9176,5 @@ function fanOutMatchCount(manager, params, language, schema, options) {
|
|
|
9141
9176
|
}
|
|
9142
9177
|
return count;
|
|
9143
9178
|
}
|
|
9144
|
-
var limitBytes = 0;
|
|
9145
|
-
var limitReadAt = Number.NEGATIVE_INFINITY;
|
|
9146
|
-
function readProcessLimit(residentBytes) {
|
|
9147
|
-
const hostBytes = totalmem();
|
|
9148
|
-
const constrained = typeof process.constrainedMemory === "function" ? process.constrainedMemory() : 0;
|
|
9149
|
-
if (Number.isFinite(constrained) && constrained > 0 && constrained < hostBytes) return constrained;
|
|
9150
|
-
if (process.platform !== "linux") return hostBytes;
|
|
9151
|
-
const availableBytes = freemem();
|
|
9152
|
-
if (!Number.isFinite(availableBytes) || availableBytes < 0) return hostBytes;
|
|
9153
|
-
return Math.min(hostBytes, residentBytes + availableBytes);
|
|
9154
|
-
}
|
|
9155
|
-
function processLimitBytes(residentBytes) {
|
|
9156
|
-
const now = performance.now();
|
|
9157
|
-
if (now - limitReadAt >= PROCESS_LIMIT_REFRESH_INTERVAL_MS) {
|
|
9158
|
-
limitBytes = readProcessLimit(residentBytes);
|
|
9159
|
-
limitReadAt = now;
|
|
9160
|
-
}
|
|
9161
|
-
return limitBytes;
|
|
9162
|
-
}
|
|
9163
|
-
function readResidentMemory() {
|
|
9164
|
-
try {
|
|
9165
|
-
const residentBytes = process.memoryUsage.rss();
|
|
9166
|
-
const limitBytes2 = processLimitBytes(residentBytes);
|
|
9167
|
-
if (!Number.isFinite(residentBytes) || !Number.isFinite(limitBytes2) || limitBytes2 <= 0) return null;
|
|
9168
|
-
return { residentBytes, limitBytes: limitBytes2 };
|
|
9169
|
-
} catch {
|
|
9170
|
-
return null;
|
|
9171
|
-
}
|
|
9172
|
-
}
|
|
9173
9179
|
|
|
9174
|
-
export { ARRAY_POSITION_GAP, DEFAULT_BM25_B, DEFAULT_BM25_K1, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS,
|
|
9180
|
+
export { ARRAY_POSITION_GAP, DEFAULT_BM25_B, DEFAULT_BM25_K1, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, MAX_BM25_B, MAX_BM25_K1, MAX_TERM_FREQUENCY, PATTERN_HOST, ValueAffixes, analyseQueryPhrases, applyPagination, applyPartitionFiltersBitset, applyProjection, applySorting, availablePatternSearch, bm25SetsValue, buildPartialWordTableFrom, clampRowCount, cloneProjected, collectQueryTermStats, copyVectorsInto, countPartialSpelling, countsWithoutScores, createBooleanIndex, createCompositePartition, createEnumIndex, createFrozenPartialWords, createGeoIndex, createNumericIndex, createPartitionIndex, createPatternWorkMeter, createSurfaceRegistry, decodePageCursor, documentValueBytes, documentWithOwnBuffers, encodeFieldIndexes, encodePageCursor, encodePartialSpellingsOf, encodeSegmentState, everyValueFacetConfig, fanOutMatchCount, fanOutQuery, filterTestCount, fulltextMatches, holdsQuotedText, isCompositePartition, joinPatternWorkMeter, kWayMerge, loadPhraseCodeFor, mergeBM25Levels, mergeDocFrequencies, mergeFacets, mergePartitionStats, normalizeSort, oversampledFacetConfig, oversampledShardSize, partialSpellingsOfDocuments, partialWordHighlighter, partialWordsToHighlight, partitionStateOf, partitionsIn, patternIndexOf, projectIncludedPaths, projectionKeepsField, pruneStatsToQueryTerms, readHeapStatistics, readOldGenerationStatistics, readProjectedPath, readResidentMemory, readSortValues, recordValueSize, registerPartialWordSearch, registerPatternSearch, requireLoadedPhraseCode, requireMatchingCursor, requirePartialWordSearchFor, requirePatternSearch, requirePatternSearchFor, requireSortableFields, requireWithinResultWindow, resolveProjection, sanitizeGlobalStats, scanPostingBlocks, setNestedValue, sortModesOf, sortSignatureEntry, sortSignatureOf, survivorDocumentsOf, undeclaredFieldOnStrictIndex, validatedFilterOf, valueWithOwnBuffers };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-BTPGQC6Z.mjs';
|
|
2
|
+
|
|
3
|
+
// src/workers/constants.ts
|
|
4
|
+
var WORKER_YOUNG_GENERATION_MB = 24;
|
|
5
|
+
var MIN_WORKER_COUNT = 2;
|
|
6
|
+
var MAX_WORKER_COUNT = 8;
|
|
7
|
+
var FALLBACK_CPU_COUNT = 4;
|
|
8
|
+
var MIN_CORES_FOR_SEVERAL_REQUEST_THREADS = 3;
|
|
9
|
+
var DEFAULT_BACKPRESSURE_LIMIT = 100;
|
|
10
|
+
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
11
|
+
var SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
12
|
+
var CONSECUTIVE_TIMEOUTS_BEFORE_DEATH = 3;
|
|
13
|
+
|
|
14
|
+
// src/workers/worker-count.ts
|
|
15
|
+
function detectCpuCount() {
|
|
16
|
+
try {
|
|
17
|
+
if (navigator?.hardwareConcurrency) {
|
|
18
|
+
return navigator.hardwareConcurrency;
|
|
19
|
+
}
|
|
20
|
+
if (typeof process !== "undefined") {
|
|
21
|
+
const ap = process.availableParallelism;
|
|
22
|
+
if (typeof ap === "function") {
|
|
23
|
+
return ap();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
} catch {
|
|
27
|
+
return FALLBACK_CPU_COUNT;
|
|
28
|
+
}
|
|
29
|
+
return FALLBACK_CPU_COUNT;
|
|
30
|
+
}
|
|
31
|
+
function resolveWorkerCount(requested) {
|
|
32
|
+
if (requested !== void 0 && requested > 0) {
|
|
33
|
+
return Math.min(requested, SCRATCH_SLOTS_PER_THREAD_POOL);
|
|
34
|
+
}
|
|
35
|
+
return Math.max(MIN_WORKER_COUNT, Math.min(MAX_WORKER_COUNT, detectCpuCount() - 1));
|
|
36
|
+
}
|
|
37
|
+
function resolveRequestThreadCount(requested) {
|
|
38
|
+
if (detectCpuCount() < MIN_CORES_FOR_SEVERAL_REQUEST_THREADS) return 1;
|
|
39
|
+
return resolveWorkerCount(requested);
|
|
40
|
+
}
|
|
41
|
+
function splitWorkerBudget(total) {
|
|
42
|
+
const keyword = Math.ceil(total / 2);
|
|
43
|
+
return { keyword, vector: total - keyword };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, DEFAULT_BACKPRESSURE_LIMIT, DEFAULT_REQUEST_TIMEOUT_MS, SHUTDOWN_TIMEOUT_MS, WORKER_YOUNG_GENERATION_MB, resolveRequestThreadCount, resolveWorkerCount, splitWorkerBudget };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NUMBER_TAG, DATE_TAG, BYTES_TAG, encodeBase64, startsWithTagPrefix, OBJECT_TAG, MILLISECONDS_PER_SECOND, NANOSECONDS_PER_MILLISECOND } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { NUMBER_TAG, DATE_TAG, BYTES_TAG, encodeBase64, startsWithTagPrefix, OBJECT_TAG, MILLISECONDS_PER_SECOND, NANOSECONDS_PER_MILLISECOND } from './chunk-NYSONUB7.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/engine/export/json-line.ts
|
|
5
5
|
function refuse(path, kind, docId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/persistence/object-store.ts
|
|
5
5
|
function objectKeyPrefix(prefix, adapter) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, reservedHeapBytes, admitHeapBytes } from './chunk-IWVEG5CX.mjs';
|
|
1
|
+
import { answerRefusalOf } from './chunk-LDGGR7YT.mjs';
|
|
3
2
|
import { nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
|
|
3
|
+
import { readRecentMemoryFigures, readMemoryFigures } from './chunk-6F6USYII.mjs';
|
|
4
4
|
import { DEFAULT_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
5
|
+
import { collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, reservedHeapBytes, admitHeapBytes } from './chunk-XIHUI4KB.mjs';
|
|
5
6
|
import { ANALYSIS_CHANGE_MEMBERS } from './chunk-EEBCDP36.mjs';
|
|
6
|
-
import { HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-
|
|
7
|
-
import { loadNativeCore } from './chunk-
|
|
8
|
-
import { MAX_FILTER_DEPTH } from './chunk-
|
|
7
|
+
import { HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-ZXNQEW43.mjs';
|
|
8
|
+
import { loadNativeCore } from './chunk-NVTFQFUL.mjs';
|
|
9
|
+
import { MAX_FILTER_DEPTH } from './chunk-U46IZNCW.mjs';
|
|
9
10
|
import { MAX_SORT_FIELDS } from './chunk-FQBFZAWG.mjs';
|
|
10
|
-
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-
|
|
11
|
+
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-MDF6PDIA.mjs';
|
|
11
12
|
import { randomUUID } from 'crypto';
|
|
12
13
|
import { mkdtemp, open, rm } from 'fs/promises';
|
|
13
14
|
import { tmpdir } from 'os';
|
|
@@ -202,6 +203,7 @@ var STATUS_BY_CODE = {
|
|
|
202
203
|
PARTITION_REBALANCING_BACKPRESSURE: 409,
|
|
203
204
|
PARTITION_CAPACITY_EXCEEDED: 409,
|
|
204
205
|
RESTORE_MEMORY_EXCEEDED: 507,
|
|
206
|
+
MEMORY_WRITE_BLOCKED: 429,
|
|
205
207
|
ANALYSIS_CHANGE_REPLACED: 409,
|
|
206
208
|
ANALYSIS_CHANGE_NOT_READY: 503,
|
|
207
209
|
ANALYSIS_GENERATION_MISSING: 503,
|
|
@@ -250,6 +252,7 @@ var STATUS_BY_CODE = {
|
|
|
250
252
|
PARTITION_UNASSIGNED: 503,
|
|
251
253
|
INSUFFICIENT_REPLICAS: 503,
|
|
252
254
|
TRANSPORT_DEPENDENCY_MISSING: 500,
|
|
255
|
+
NATIVE_DEPENDENCY_MISSING: 500,
|
|
253
256
|
ALLOCATION_INVALID_CONFIG: 400,
|
|
254
257
|
ALLOCATION_NO_DATA_NODES: 503,
|
|
255
258
|
ALLOCATION_FAILED: 503,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LOOKUP_KEY_SCRATCH_BYTES } from './chunk-4UMZ7KQL.mjs';
|
|
2
|
-
import { createNarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { createNarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
|
|
3
3
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
4
4
|
|
|
5
5
|
// src/core/tokenizer/constants.ts
|