@delali/narsil 0.3.1-next.157 → 0.3.1-next.161
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 +3 -3
- package/dist/adapters/gcs.mjs +3 -3
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +3 -3
- package/dist/browser/{chunk-N23GL72Q.mjs → chunk-4RNSFVWI.mjs} +20777 -19056
- package/dist/browser/chunk-MMHIIL5B.mjs +564 -0
- package/dist/browser/chunk-MZHQ65VI.mjs +1228 -0
- package/dist/browser/chunk-WC2DEXWU.mjs +29 -0
- package/dist/browser/{chunk-VLJQW4J6.mjs → core-leaf-TJAGWPZZ.mjs} +4674 -3102
- package/dist/{react-native/chunks/durability-config-QXVZEO7T.mjs → browser/durability-config-SGB5ZP5K.mjs} +8 -3
- package/dist/browser/embed-RF2MPGAO.mjs +222 -0
- package/dist/{react-native/chunks/geo-index-PX3BIHAH.mjs → browser/geo-index-GNHY4PUB.mjs} +190 -93
- package/dist/{react-native/chunks/module-TTEVPRCW.mjs → browser/module-362VSIGR.mjs} +1570 -275
- package/dist/browser/msgpack-leaf-44XNWSSY.mjs +302 -0
- package/dist/browser/optional-reads-XMVPG6HG.mjs +3230 -0
- package/dist/browser/optional-writes-WMZX4OEC.mjs +3196 -0
- package/dist/browser/phrase-module-22TKMXWI.mjs +616 -0
- package/dist/browser/resolve-vector-text-KI65IHMD.mjs +60 -0
- package/dist/browser/{restore-hooks-IE3GGYHG.mjs → restore-queue-S4BWOGMU.mjs} +98 -24
- package/dist/{react-native/chunks/runtime-R5E3TB3J.mjs → browser/runtime-NU6VOVH2.mjs} +61 -25
- package/dist/browser/segment-codec-leaf-A427QJUX.mjs +554 -0
- package/dist/browser/segment-merge-leaf-7BZ54JPI.mjs +1636 -0
- package/dist/browser/storage-leaf-X6CNRHJS.mjs +18221 -0
- package/dist/browser/store-leaf-AEMTAVHX.mjs +2069 -0
- package/dist/browser/{chunk-GFAZPSWK.mjs → suggestions-leaf-3Y6MR6OF.mjs} +441 -119
- package/dist/browser/worker-copies-WQCPP3TS.mjs +2750 -0
- package/dist/{capabilities-D3AoBJoF.d.ts → capabilities-BKDrry0z.d.ts} +2 -2
- package/dist/chunk-2JRERUNZ.mjs +217 -0
- package/dist/chunk-2RIS76RJ.mjs +212 -0
- package/dist/chunk-3B775F3C.mjs +252 -0
- package/dist/{chunk-24FNVRKB.mjs → chunk-3D6RZGJH.mjs} +3 -3
- package/dist/{chunk-INJYO3BU.mjs → chunk-4CAMH7FO.mjs} +1 -1
- package/dist/{chunk-U476IXKQ.mjs → chunk-4PY4JYMY.mjs} +2 -1
- package/dist/chunk-6EZW2GQL.mjs +978 -0
- package/dist/chunk-75UNINFA.mjs +271 -0
- package/dist/chunk-77AUVDQ5.mjs +7 -0
- package/dist/{chunk-JTYPJF3T.mjs → chunk-7MWYORQC.mjs} +2 -2
- package/dist/{chunk-TGP5M5R7.mjs → chunk-7T4LAYT4.mjs} +1 -1
- package/dist/{chunk-XIHUI4KB.mjs → chunk-AB27FWZM.mjs} +8 -3
- package/dist/{chunk-FUD5XSZ5.mjs → chunk-BXM7XM4G.mjs} +7 -3
- package/dist/{chunk-HJJI72X7.mjs → chunk-C7YQHCSO.mjs} +1 -1
- package/dist/{chunk-RVGRFOGN.mjs → chunk-D456ZFPQ.mjs} +2 -1
- package/dist/{chunk-KKQC526K.mjs → chunk-E2F6LZR3.mjs} +19 -21
- package/dist/{chunk-SMOOSIAW.mjs → chunk-FE3MRIBN.mjs} +104 -13
- package/dist/{chunk-KYYABCSW.mjs → chunk-FETZYCH7.mjs} +15 -1
- package/dist/{chunk-XXJZMTZT.mjs → chunk-FVZ5DB6Y.mjs} +3 -2
- package/dist/{chunk-EYD7K3H6.mjs → chunk-GF4K7IUK.mjs} +317 -120
- package/dist/chunk-GXCDWLQI.mjs +193 -0
- package/dist/{chunk-IIRIG7H5.mjs → chunk-H64YDF5M.mjs} +3 -3
- package/dist/{browser/chunk-VY5KW3HN.mjs → chunk-HOOR4CP5.mjs} +63 -7
- package/dist/chunk-IB4BYLE3.mjs +127 -0
- package/dist/{chunk-3C7MTCCI.mjs → chunk-IE3Q62QD.mjs} +2 -2
- package/dist/chunk-IH3G6SJO.mjs +40 -0
- package/dist/chunk-JV74RKCY.mjs +3041 -0
- package/dist/{chunk-ZPZ3YGXV.mjs → chunk-K67I3RF4.mjs} +261 -101
- package/dist/chunk-KLVMK3R5.mjs +47 -0
- package/dist/{chunk-5VV4R6P7.mjs → chunk-LAWIJRMJ.mjs} +4154 -2577
- package/dist/chunk-LF4GB4PO.mjs +281 -0
- package/dist/chunk-NC4QLCZC.mjs +59 -0
- package/dist/chunk-OOO54OVC.mjs +627 -0
- package/dist/chunk-OUWZKNO3.mjs +207 -0
- package/dist/{chunk-FJKKCV4D.mjs → chunk-P5YLI5ED.mjs} +343 -182
- package/dist/{chunk-4ZTHGTVX.mjs → chunk-PTTMGRG5.mjs} +9 -10
- package/dist/{react-native/chunks/chunk-DZ7H7D2C.mjs → chunk-Q3ZZH5Z7.mjs} +6 -0
- package/dist/{browser/chunk-EKMGCRSR.mjs → chunk-QBVTYY4J.mjs} +2 -9
- package/dist/{chunk-W5EB5XKI.mjs → chunk-R4CE4IVU.mjs} +341 -183
- package/dist/chunk-S2POFTLN.mjs +10 -0
- package/dist/{chunk-KJ3RTZDJ.mjs → chunk-S3BSDBF7.mjs} +10 -3
- package/dist/{chunk-4LMSZAK6.mjs → chunk-SHGN3QIF.mjs} +69 -13
- package/dist/chunk-SXIRM4MX.mjs +3549 -0
- package/dist/{chunk-TBC3XUL2.mjs → chunk-TGPKS2UM.mjs} +47 -1
- package/dist/chunk-TINW4BSH.mjs +31301 -0
- package/dist/{cold-module-VOJXMNZB.mjs → chunk-TSLV5P2J.mjs} +397 -80
- package/dist/{chunk-HHBUCIUY.mjs → chunk-TW543F33.mjs} +3 -3
- package/dist/chunk-U6B7DUQW.mjs +788 -0
- package/dist/{chunk-OQLD2BSW.mjs → chunk-V3SGPXWQ.mjs} +8 -9
- package/dist/chunk-W34VJXY7.mjs +4723 -0
- package/dist/chunk-YETKPX5M.mjs +5 -0
- package/dist/chunk-ZQ6QY42L.mjs +59 -0
- package/dist/{client-kqSMevVi.d.ts → client-CTp8RRiK.d.ts} +4 -4
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +66 -18
- package/dist/{config-B4v_Htpu.d.ts → config-PCNzWjHL.d.ts} +6 -3
- package/dist/{config-CTP01fns.d.ts → config-_WT5grSL.d.ts} +3 -3
- package/dist/core-leaf-KXFGP74A.mjs +7 -0
- package/dist/digest-leaf-KXBGKYHZ.mjs +1 -0
- package/dist/direct-executor-MKTZBR26.mjs +16 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +7 -4
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -2
- package/dist/distribution/transport/grpc.mjs +7 -2
- package/dist/distribution/transport/tcp.mjs +7 -1
- package/dist/distribution.d.ts +7 -7
- package/dist/distribution.mjs +1199 -1092
- package/dist/{browser/durability-config-TIYKW6XX.mjs → durability-config-XV4XR7Y4.mjs} +7 -3
- package/dist/embed-4H7RTBVL.mjs +221 -0
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CkPn2PWE.d.ts → engine-DBRVR_d-.d.ts} +1252 -1239
- package/dist/{browser/geo-index-OTV7VPIR.mjs → geo-index-2ZMMWWSK.mjs} +190 -93
- package/dist/{index-C4AmUnl1.d.ts → index-Ck9w5WHz.d.ts} +1 -1
- package/dist/index.browser.mjs +4 -16
- package/dist/index.d.ts +1495 -78
- package/dist/index.mjs +14 -50
- package/dist/index.react-native.mjs +11 -28
- package/dist/invalidation/filesystem.mjs +1 -2
- package/dist/languages/albanian.mjs +1 -1
- package/dist/languages/amharic.mjs +1 -1
- package/dist/languages/arabic.mjs +1 -1
- package/dist/languages/armenian.mjs +1 -1
- package/dist/languages/azerbaijani.mjs +1 -1
- package/dist/languages/bambara.mjs +1 -1
- package/dist/languages/basque.mjs +1 -1
- package/dist/languages/belarusian.mjs +1 -1
- package/dist/languages/bengali.mjs +1 -1
- package/dist/languages/bosnian.mjs +1 -1
- package/dist/languages/breton.mjs +1 -1
- package/dist/languages/bulgarian.mjs +1 -1
- package/dist/languages/burmese.mjs +1 -1
- package/dist/languages/catalan.mjs +1 -1
- package/dist/languages/chinese.mjs +1 -1
- package/dist/languages/croatian.mjs +1 -1
- package/dist/languages/czech.mjs +1 -1
- package/dist/languages/dagbani.mjs +1 -1
- package/dist/languages/danish.mjs +1 -1
- package/dist/languages/dutch.mjs +1 -1
- package/dist/languages/english.mjs +1 -1
- package/dist/languages/esperanto.mjs +1 -1
- package/dist/languages/estonian.mjs +1 -1
- package/dist/languages/ewe.mjs +1 -1
- package/dist/languages/faroese.mjs +1 -1
- package/dist/languages/fijian.mjs +1 -1
- package/dist/languages/finnish.mjs +1 -1
- package/dist/languages/french.mjs +1 -1
- package/dist/languages/ga.mjs +1 -1
- package/dist/languages/galician.mjs +1 -1
- package/dist/languages/georgian.mjs +1 -1
- package/dist/languages/german.mjs +1 -1
- package/dist/languages/greek.mjs +1 -1
- package/dist/languages/guarani.mjs +1 -1
- package/dist/languages/gujarati.mjs +1 -1
- package/dist/languages/haitian-creole.mjs +1 -1
- package/dist/languages/hausa.mjs +1 -1
- package/dist/languages/hawaiian.mjs +1 -1
- package/dist/languages/hebrew.mjs +1 -1
- package/dist/languages/hindi.mjs +1 -1
- package/dist/languages/hungarian.mjs +1 -1
- package/dist/languages/icelandic.mjs +1 -1
- package/dist/languages/igbo.mjs +1 -1
- package/dist/languages/indonesian.mjs +1 -1
- package/dist/languages/irish.mjs +1 -1
- package/dist/languages/italian.mjs +1 -1
- package/dist/languages/japanese.mjs +1 -1
- package/dist/languages/kannada.mjs +1 -1
- package/dist/languages/kazakh.mjs +1 -1
- package/dist/languages/khmer.mjs +1 -1
- package/dist/languages/kinyarwanda.mjs +1 -1
- package/dist/languages/kirundi.mjs +1 -1
- package/dist/languages/korean.mjs +1 -1
- package/dist/languages/kurmanji.mjs +1 -1
- package/dist/languages/kyrgyz.mjs +1 -1
- package/dist/languages/lao.mjs +1 -1
- package/dist/languages/latin.mjs +1 -1
- package/dist/languages/latvian.mjs +1 -1
- package/dist/languages/lingala.mjs +1 -1
- package/dist/languages/lithuanian.mjs +1 -1
- package/dist/languages/luxembourgish.mjs +1 -1
- package/dist/languages/macedonian.mjs +1 -1
- package/dist/languages/malagasy.mjs +1 -1
- package/dist/languages/malay.mjs +1 -1
- package/dist/languages/malayalam.mjs +1 -1
- package/dist/languages/maltese.mjs +1 -1
- package/dist/languages/maori.mjs +1 -1
- package/dist/languages/marathi.mjs +1 -1
- package/dist/languages/nepali.mjs +1 -1
- package/dist/languages/norwegian.mjs +1 -1
- package/dist/languages/oromo.mjs +1 -1
- package/dist/languages/persian.mjs +1 -1
- package/dist/languages/polish.mjs +1 -1
- package/dist/languages/portuguese.mjs +1 -1
- package/dist/languages/punjabi.mjs +1 -1
- package/dist/languages/romanian.mjs +1 -1
- package/dist/languages/russian.mjs +1 -1
- package/dist/languages/samoan.mjs +1 -1
- package/dist/languages/sanskrit.mjs +1 -1
- package/dist/languages/scottish-gaelic.mjs +1 -1
- package/dist/languages/serbian.mjs +1 -1
- package/dist/languages/shona.mjs +1 -1
- package/dist/languages/sinhala.mjs +1 -1
- package/dist/languages/slovak.mjs +1 -1
- package/dist/languages/slovenian.mjs +1 -1
- package/dist/languages/sorani.mjs +1 -1
- package/dist/languages/spanish.mjs +1 -1
- package/dist/languages/swahili.mjs +1 -1
- package/dist/languages/swedish.mjs +1 -1
- package/dist/languages/tagalog.mjs +1 -1
- package/dist/languages/tamil.mjs +1 -1
- package/dist/languages/tatar.mjs +1 -1
- package/dist/languages/telugu.mjs +1 -1
- package/dist/languages/thai.mjs +1 -1
- package/dist/languages/tibetan.mjs +1 -1
- package/dist/languages/tigrinya.mjs +1 -1
- package/dist/languages/tongan.mjs +1 -1
- package/dist/languages/turkish.mjs +1 -1
- package/dist/languages/twi.mjs +1 -1
- package/dist/languages/ukrainian.mjs +1 -1
- package/dist/languages/urdu.mjs +1 -1
- package/dist/languages/vietnamese.mjs +1 -1
- package/dist/languages/welsh.mjs +1 -1
- package/dist/languages/wolof.mjs +1 -1
- package/dist/languages/xhosa.mjs +1 -1
- package/dist/languages/yoruba.mjs +1 -1
- package/dist/languages/zulu.mjs +1 -1
- package/dist/{long-query-thread-QDFQSJD6.mjs → long-query-thread-JMGNGF6V.mjs} +74 -58
- package/dist/{module-N55W4Q5C.mjs → module-ZJ6ARG6V.mjs} +444 -111
- package/dist/msgpack-leaf-5WFRP6JM.mjs +9 -0
- package/dist/optional-reads-BR3BOVZW.mjs +3373 -0
- package/dist/optional-writes-DDFHYUOH.mjs +218 -0
- package/dist/{paged-partition-archive-RLRGOXDX.mjs → paged-partition-archive-G576XGVE.mjs} +29 -69
- package/dist/partial-words.browser.mjs +1649 -0
- package/dist/partial-words.mjs +15 -14
- package/dist/{chunk-CITFCZKF.mjs → pattern.browser.mjs} +153 -186
- package/dist/pattern.mjs +6 -8
- package/dist/persistence/durability/checkpoint-worker.d.ts +32 -24
- package/dist/persistence/durability/checkpoint-worker.mjs +27 -59
- package/dist/phrase-module-XK3T44VU.mjs +634 -0
- package/dist/query-actions-OMXJEC2J.mjs +118 -0
- package/dist/query-suggestions/merge-worker.mjs +18 -54
- package/dist/query-suggestions.browser.mjs +26 -227
- package/dist/query-suggestions.d.ts +2 -2
- package/dist/query-suggestions.mjs +16 -67
- package/dist/react-native/chunks/chunk-4EXKQ2IB.mjs +565 -0
- package/dist/react-native/chunks/chunk-52QD7CBJ.mjs +52 -0
- package/dist/react-native/chunks/chunk-72OKYHZL.mjs +969 -0
- package/dist/react-native/chunks/chunk-AQOWRH2C.mjs +802 -0
- package/dist/react-native/chunks/{chunk-4COWCEY7.mjs → chunk-FTQ7JNMU.mjs} +341 -180
- package/dist/react-native/chunks/chunk-G3CUQ333.mjs +42 -0
- package/dist/react-native/chunks/{chunk-EJ33LCHV.mjs → chunk-HRDMIQ63.mjs} +53 -1
- package/dist/react-native/chunks/{chunk-4AV5PPH6.mjs → chunk-IY6U6HRA.mjs} +63 -7
- package/dist/react-native/chunks/chunk-J2NQW353.mjs +212 -0
- package/dist/react-native/chunks/chunk-L4R5ITVG.mjs +29047 -0
- package/dist/react-native/chunks/{chunk-OXM66LO6.mjs → chunk-OK3WUA6N.mjs} +2 -10
- package/dist/react-native/chunks/{chunk-MVXELMJX.mjs → chunk-PVMEHBQO.mjs} +1 -1
- package/dist/{browser/chunk-SRMZXJSL.mjs → react-native/chunks/chunk-TQ26BKBH.mjs} +6 -0
- package/dist/{browser/chunk-GPPOG6PT.mjs → react-native/chunks/chunk-VUJCSQG5.mjs} +3 -1
- package/dist/react-native/chunks/{chunk-ENLMYKSX.mjs → chunk-XEGKQKLY.mjs} +5385 -3114
- package/dist/react-native/chunks/chunk-YOTP2FPE.mjs +232 -0
- package/dist/react-native/chunks/chunk-ZIU6TWXG.mjs +127 -0
- package/dist/react-native/chunks/core-leaf-5B4JXCVA.mjs +6 -0
- package/dist/react-native/chunks/digest-leaf-X6OIFDIU.mjs +1 -0
- package/dist/{durability-config-GE4U7MCZ.mjs → react-native/chunks/durability-config-3IOXIPYZ.mjs} +7 -3
- package/dist/react-native/chunks/embed-3WQ2CCR5.mjs +221 -0
- package/dist/{geo-index-MRH5JMIR.mjs → react-native/chunks/geo-index-QEYKEVPH.mjs} +190 -93
- package/dist/react-native/chunks/{chunk-CKNRFDTZ.mjs → gzip.react-native-DLO4WW27.mjs} +2 -1
- package/dist/{browser/module-TCT66FWA.mjs → react-native/chunks/module-VUA27HZZ.mjs} +1018 -540
- package/dist/react-native/chunks/msgpack-leaf-TR66ZVAX.mjs +7 -0
- package/dist/react-native/chunks/optional-reads-WDTLLHUT.mjs +3364 -0
- package/dist/react-native/chunks/optional-writes-FZV3QW34.mjs +267 -0
- package/dist/react-native/chunks/phrase-module-KCQWVXYZ.mjs +635 -0
- package/dist/react-native/chunks/resolve-vector-text-LXRYXF7M.mjs +59 -0
- package/dist/react-native/chunks/restore-queue-EI2V2I4S.mjs +179 -0
- package/dist/{browser/runtime-OTAGEFQW.mjs → react-native/chunks/runtime-BUCSAK4U.mjs} +61 -25
- package/dist/react-native/chunks/segment-codec-leaf-6ULP7H3I.mjs +12 -0
- package/dist/react-native/chunks/segment-merge-leaf-F4GQZNK6.mjs +13 -0
- package/dist/react-native/chunks/storage-leaf-OAXBU2L6.mjs +18042 -0
- package/dist/react-native/chunks/store-leaf-GY2ZZFXB.mjs +14 -0
- package/dist/react-native/chunks/{chunk-WW2X2AEI.mjs → suggestions-leaf-SQEZ4IBS.mjs} +332 -118
- package/dist/react-native/chunks/worker-copies-EEHSCFJW.mjs +2627 -0
- package/dist/react-native/partial-words.mjs +954 -35
- package/dist/react-native/pattern.mjs +238 -111
- package/dist/react-native/query-suggestions.mjs +33 -239
- package/dist/react-native/sync.mjs +95 -52
- package/dist/react-native/synonyms.mjs +256 -112
- package/dist/react.d.ts +9 -9
- package/dist/react.mjs +6 -0
- package/dist/{rerank-MQ37IYRV.mjs → rerank-Y6MWBMTT.mjs} +17 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/resolve-vector-text-4PDRTPNQ.mjs +2 -0
- package/dist/restore-queue-KPYSRJ4A.mjs +184 -0
- package/dist/runtime-4GKUIAKV.mjs +595 -0
- package/dist/{schema-Jwt928nJ.d.ts → schema-C_7yRJLt.d.ts} +1 -1
- package/dist/segment-codec-leaf-6IFBSBPN.mjs +17 -0
- package/dist/segment-merge-leaf-VE3FUSVE.mjs +17 -0
- package/dist/server.d.ts +33 -13
- package/dist/server.mjs +81 -100
- package/dist/{browser/durability-wiring-GVZEE46O.mjs → storage-leaf-HMIIOUYN.mjs} +2334 -931
- package/dist/store-leaf-M7T7SUZJ.mjs +19 -0
- package/dist/stored-values-BWIMpiT_.d.ts +25 -0
- package/dist/suggestions-leaf-Q3Q5D6XV.mjs +53 -0
- package/dist/sync/filesystem.d.ts +3 -3
- package/dist/sync/filesystem.mjs +27 -11
- package/dist/sync/indexeddb.browser.mjs +287 -0
- package/dist/sync/indexeddb.d.ts +3 -3
- package/dist/sync/indexeddb.mjs +7 -2
- package/dist/sync.browser.mjs +88 -72
- package/dist/sync.d.ts +4 -4
- package/dist/sync.mjs +89 -59
- package/dist/{chunk-I5B7RXU7.mjs → synonyms.browser.mjs} +248 -135
- package/dist/synonyms.mjs +15 -11
- package/dist/{tasks-CoNjxbop.d.ts → tasks-B4tT4vmP.d.ts} +4 -4
- package/dist/thread-SNILJXX3.mjs +30 -0
- package/dist/{types-DPMjfOr_.d.ts → types-CTg0KaMy.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +7 -1
- package/dist/vector/search-worker.mjs +9 -13
- package/dist/worker-copies-ZLZS2CUM.mjs +2152 -0
- package/dist/workers/entry.mjs +60 -30
- package/openapi.json +66 -50
- package/package.json +233 -8
- package/dist/analysis-change-CKEMM2MC.mjs +0 -55
- package/dist/analysis-change-entry-SEDMJ6MW.mjs +0 -1
- package/dist/archive-history-E4R73RWD.mjs +0 -29
- package/dist/browser/analysis-change-ZKGJFENM.mjs +0 -942
- package/dist/browser/analysis-change-entry-5BFUVMHJ.mjs +0 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +0 -29
- package/dist/browser/chunk-25MTVDYD.mjs +0 -432
- package/dist/browser/chunk-3I27KXQD.mjs +0 -34
- package/dist/browser/chunk-3NLMB5CC.mjs +0 -217
- package/dist/browser/chunk-4RD3AFSB.mjs +0 -32
- package/dist/browser/chunk-5W3MMTLG.mjs +0 -19
- package/dist/browser/chunk-5YWB3E2W.mjs +0 -92
- package/dist/browser/chunk-7IGKGWSQ.mjs +0 -79
- package/dist/browser/chunk-AI5UI46D.mjs +0 -12
- package/dist/browser/chunk-ATEBYXP6.mjs +0 -10
- package/dist/browser/chunk-BLT4RHCJ.mjs +0 -241
- package/dist/browser/chunk-C26SPCGQ.mjs +0 -2636
- package/dist/browser/chunk-C4FJ3WDY.mjs +0 -177
- package/dist/browser/chunk-CXNTHHA7.mjs +0 -63
- package/dist/browser/chunk-DSXIBE6N.mjs +0 -78
- package/dist/browser/chunk-DUH6QUVU.mjs +0 -2374
- package/dist/browser/chunk-ELV4OZOI.mjs +0 -29
- package/dist/browser/chunk-EXQZGUQH.mjs +0 -193
- package/dist/browser/chunk-G64Q6OJF.mjs +0 -96
- package/dist/browser/chunk-HOZW3PKP.mjs +0 -9
- package/dist/browser/chunk-HUCSHDTB.mjs +0 -100
- package/dist/browser/chunk-JPTQZWJQ.mjs +0 -10
- package/dist/browser/chunk-K3IPRX6D.mjs +0 -2559
- package/dist/browser/chunk-ML7THVLJ.mjs +0 -38
- package/dist/browser/chunk-MY2XKH22.mjs +0 -40
- package/dist/browser/chunk-NLWTBAGB.mjs +0 -111
- package/dist/browser/chunk-NXQG7DRA.mjs +0 -318
- package/dist/browser/chunk-OEDCEZXJ.mjs +0 -92
- package/dist/browser/chunk-OIZS5KIX.mjs +0 -6
- package/dist/browser/chunk-RA6LSBCM.mjs +0 -43
- package/dist/browser/chunk-TK63WFXK.mjs +0 -90
- package/dist/browser/chunk-TY7L6OXO.mjs +0 -69
- package/dist/browser/chunk-U3JOQGWX.mjs +0 -19
- package/dist/browser/chunk-U4YDIBUT.mjs +0 -653
- package/dist/browser/chunk-UATIJ4KU.mjs +0 -21
- package/dist/browser/chunk-UKOWD2K5.mjs +0 -315
- package/dist/browser/chunk-UTMHUHUV.mjs +0 -150
- package/dist/browser/chunk-V43N6TZO.mjs +0 -857
- package/dist/browser/chunk-VI7BQR4U.mjs +0 -21
- package/dist/browser/chunk-WN464PTL.mjs +0 -375
- package/dist/browser/chunk-WXLBZJMT.mjs +0 -25
- package/dist/browser/chunk-X7TXYUKO.mjs +0 -86
- package/dist/browser/chunk-XAWNZ4G2.mjs +0 -151
- package/dist/browser/chunk-Y6IBAUNO.mjs +0 -561
- package/dist/browser/chunk-ZI2V4VD7.mjs +0 -21
- package/dist/browser/cold-module-YNUUDNOM.mjs +0 -761
- package/dist/browser/engine-hooks-HBVS6YM4.mjs +0 -18
- package/dist/browser/gzip-5S7ROJFJ.mjs +0 -1
- package/dist/browser/import-5ESVMFDJ.mjs +0 -20
- package/dist/browser/methods-KTQCSIN4.mjs +0 -30
- package/dist/browser/module-NDSQLPMQ.mjs +0 -25
- package/dist/browser/operations-OJ3BXS55.mjs +0 -5
- package/dist/browser/phrase-module-HAT3TLZN.mjs +0 -328
- package/dist/browser/pool-3JLET5RO.mjs +0 -297
- package/dist/browser/release-HYXPVJVS.mjs +0 -32
- package/dist/browser/restore-queue-LQBBTODR.mjs +0 -55
- package/dist/browser/retention-TY3L3BFN.mjs +0 -211
- package/dist/browser/snapshot-5FHPPCNZ.mjs +0 -965
- package/dist/browser/start-2UZTOBG5.mjs +0 -26
- package/dist/browser/sync-state-P5XG6LTQ.mjs +0 -15
- package/dist/browser/write-ULXAN5B4.mjs +0 -196
- package/dist/chunk-2NE7VCYE.mjs +0 -212
- package/dist/chunk-2ROUFMQX.mjs +0 -543
- package/dist/chunk-37CD3OKS.mjs +0 -87
- package/dist/chunk-3MXV3VHR.mjs +0 -46
- package/dist/chunk-3OH67G7R.mjs +0 -214
- package/dist/chunk-4B7JIGQD.mjs +0 -106
- package/dist/chunk-5YNRKI2C.mjs +0 -81
- package/dist/chunk-6HTGOXIK.mjs +0 -875
- package/dist/chunk-6OEGXLBX.mjs +0 -57
- package/dist/chunk-6RC4K46J.mjs +0 -86
- package/dist/chunk-7GFE3PEY.mjs +0 -40
- package/dist/chunk-7GXJUJ24.mjs +0 -49
- package/dist/chunk-7V5IUP2T.mjs +0 -63
- package/dist/chunk-A4L7YTKX.mjs +0 -458
- package/dist/chunk-BEZH7VEH.mjs +0 -23
- package/dist/chunk-BNL5OPRV.mjs +0 -634
- package/dist/chunk-BTPGQC6Z.mjs +0 -27
- package/dist/chunk-C7XQYG6U.mjs +0 -50
- package/dist/chunk-CQZXZ75V.mjs +0 -562
- package/dist/chunk-CWS55TEX.mjs +0 -242
- package/dist/chunk-CZQ33DLW.mjs +0 -78
- package/dist/chunk-EEBCDP36.mjs +0 -32
- package/dist/chunk-FB6463IN.mjs +0 -1499
- package/dist/chunk-FCJ553HS.mjs +0 -655
- package/dist/chunk-FEZVDOWX.mjs +0 -6996
- package/dist/chunk-FOCV4CBZ.mjs +0 -87
- package/dist/chunk-FQBFZAWG.mjs +0 -27
- package/dist/chunk-G6HRSGOU.mjs +0 -74
- package/dist/chunk-GES7U2PM.mjs +0 -68
- package/dist/chunk-GH4WQ22V.mjs +0 -34
- package/dist/chunk-GPWMUPCA.mjs +0 -1126
- package/dist/chunk-GQPTDQCL.mjs +0 -54
- package/dist/chunk-HJSN7UYG.mjs +0 -10
- package/dist/chunk-I54T6CQP.mjs +0 -117
- package/dist/chunk-IPN7S4KX.mjs +0 -130
- package/dist/chunk-J4IJTTEX.mjs +0 -226
- package/dist/chunk-JSV6OQ4C.mjs +0 -74
- package/dist/chunk-K4ZIGL2O.mjs +0 -290
- package/dist/chunk-KAKQ74LS.mjs +0 -53
- package/dist/chunk-KCQYFO4K.mjs +0 -62
- package/dist/chunk-KHKIRS5D.mjs +0 -113
- package/dist/chunk-KOKM4PQN.mjs +0 -52
- package/dist/chunk-KP7TYHWT.mjs +0 -92
- package/dist/chunk-KZ3NX2P7.mjs +0 -21
- package/dist/chunk-L5ORED7V.mjs +0 -25
- package/dist/chunk-LDNCLRZU.mjs +0 -218
- package/dist/chunk-LHKOSI2J.mjs +0 -58
- package/dist/chunk-LQG5G2LY.mjs +0 -39
- package/dist/chunk-MATMVH65.mjs +0 -9
- package/dist/chunk-MP7ABPTD.mjs +0 -189
- package/dist/chunk-MW6BR4QP.mjs +0 -316
- package/dist/chunk-MWD5VPN7.mjs +0 -21
- package/dist/chunk-ODYKO5TO.mjs +0 -101
- package/dist/chunk-OG7UGJ6F.mjs +0 -63
- package/dist/chunk-ORN5BLL7.mjs +0 -11
- package/dist/chunk-OYABFKTW.mjs +0 -1974
- package/dist/chunk-P5LANSH6.mjs +0 -121
- package/dist/chunk-PELHVTO7.mjs +0 -24
- package/dist/chunk-PIH5SJ4N.mjs +0 -7481
- package/dist/chunk-PSZI4O24.mjs +0 -253
- package/dist/chunk-PV2CG7EJ.mjs +0 -886
- package/dist/chunk-PWGYQXML.mjs +0 -470
- package/dist/chunk-Q2UL2TPC.mjs +0 -21
- package/dist/chunk-QHPYS427.mjs +0 -66
- package/dist/chunk-QJVOLKU6.mjs +0 -111
- package/dist/chunk-QLDABJZM.mjs +0 -20
- package/dist/chunk-QYRNLLLI.mjs +0 -99
- package/dist/chunk-RCX4WNLC.mjs +0 -151
- package/dist/chunk-RFBLQLLZ.mjs +0 -16
- package/dist/chunk-RIHIVFIQ.mjs +0 -240
- package/dist/chunk-RLOES5SX.mjs +0 -31
- package/dist/chunk-RWURUDSP.mjs +0 -2639
- package/dist/chunk-RZWWB2XR.mjs +0 -96
- package/dist/chunk-S5LN746F.mjs +0 -10
- package/dist/chunk-SOI6LTHM.mjs +0 -216
- package/dist/chunk-SQJWAIF4.mjs +0 -12
- package/dist/chunk-TDIK6NTV.mjs +0 -10
- package/dist/chunk-TQXHPFWT.mjs +0 -177
- package/dist/chunk-U55XJEIG.mjs +0 -18
- package/dist/chunk-UD5HIS4U.mjs +0 -382
- package/dist/chunk-UHICS3JI.mjs +0 -83
- package/dist/chunk-UJDJB3NE.mjs +0 -913
- package/dist/chunk-VD7J552I.mjs +0 -28
- package/dist/chunk-VSLSGASN.mjs +0 -30
- package/dist/chunk-VZ2ONHEE.mjs +0 -3715
- package/dist/chunk-W7OSSKH5.mjs +0 -1427
- package/dist/chunk-WZ7YV54N.mjs +0 -152
- package/dist/chunk-X5CV2E2B.mjs +0 -1
- package/dist/chunk-Y4WPNHMC.mjs +0 -50
- package/dist/chunk-YEKL4JBK.mjs +0 -96
- package/dist/chunk-ZXNQEW43.mjs +0 -18
- package/dist/chunk-ZYAY26KG.mjs +0 -29
- package/dist/direct-executor-V5DRIECI.mjs +0 -34
- package/dist/durability-wiring-3TD62MBI.mjs +0 -4072
- package/dist/engine-hooks-HA3SBOBR.mjs +0 -54
- package/dist/gzip-F4HMIEEQ.mjs +0 -1
- package/dist/import-GPKLTSKA.mjs +0 -56
- package/dist/methods-7IOINERF.mjs +0 -30
- package/dist/module-JYHFTVPS.mjs +0 -63
- package/dist/operations-G5EP6JPX.mjs +0 -5
- package/dist/phrase-module-XW5MKWP5.mjs +0 -330
- package/dist/pool-Y4A46T36.mjs +0 -298
- package/dist/react-native/chunks/analysis-change-QUVDNABS.mjs +0 -934
- package/dist/react-native/chunks/analysis-change-entry-OC4XASBF.mjs +0 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +0 -29
- package/dist/react-native/chunks/chunk-2PRHILX3.mjs +0 -529
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +0 -1
- package/dist/react-native/chunks/chunk-3WI35N75.mjs +0 -226
- package/dist/react-native/chunks/chunk-4DII3ZSM.mjs +0 -73
- package/dist/react-native/chunks/chunk-4J74WHQM.mjs +0 -177
- package/dist/react-native/chunks/chunk-4NWR3NGS.mjs +0 -151
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +0 -17
- package/dist/react-native/chunks/chunk-5MSX5FRT.mjs +0 -858
- package/dist/react-native/chunks/chunk-6OFDUYVX.mjs +0 -92
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +0 -9
- package/dist/react-native/chunks/chunk-6ZELFCK5.mjs +0 -315
- package/dist/react-native/chunks/chunk-AAAETEJK.mjs +0 -27
- package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +0 -32
- package/dist/react-native/chunks/chunk-BITYFZSZ.mjs +0 -242
- package/dist/react-native/chunks/chunk-C5G6TJ7A.mjs +0 -140
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +0 -43
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +0 -10
- package/dist/react-native/chunks/chunk-DMIFXZ3Q.mjs +0 -432
- package/dist/react-native/chunks/chunk-DVDX4SDR.mjs +0 -375
- package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +0 -12
- package/dist/react-native/chunks/chunk-F753DA54.mjs +0 -23
- package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +0 -40
- package/dist/react-native/chunks/chunk-FTZHMRD2.mjs +0 -18
- package/dist/react-native/chunks/chunk-HJBJBH26.mjs +0 -34
- package/dist/react-native/chunks/chunk-IAENKE2D.mjs +0 -21
- package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +0 -10
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +0 -111
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +0 -38
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +0 -15
- package/dist/react-native/chunks/chunk-KSBYEMCB.mjs +0 -100
- package/dist/react-native/chunks/chunk-KU646XXT.mjs +0 -164
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +0 -68
- package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +0 -93
- package/dist/react-native/chunks/chunk-LZSLNSUN.mjs +0 -193
- package/dist/react-native/chunks/chunk-MJDQU5MW.mjs +0 -1225
- package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +0 -8
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +0 -78
- package/dist/react-native/chunks/chunk-OCSLSH27.mjs +0 -22723
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +0 -29
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +0 -79
- package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +0 -9
- package/dist/react-native/chunks/chunk-RDWG33MM.mjs +0 -79
- package/dist/react-native/chunks/chunk-SK2PWYDH.mjs +0 -654
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +0 -96
- package/dist/react-native/chunks/chunk-TORU2OHQ.mjs +0 -218
- package/dist/react-native/chunks/chunk-U4KSKA4Z.mjs +0 -23
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +0 -68
- package/dist/react-native/chunks/chunk-WBYQRHDY.mjs +0 -86
- package/dist/react-native/chunks/chunk-WVWJNUMN.mjs +0 -2562
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +0 -288
- package/dist/react-native/chunks/chunk-YZW4CHM6.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZNZ6CPAZ.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZVQMBF2H.mjs +0 -63
- package/dist/react-native/chunks/chunk-ZWAIN4GG.mjs +0 -2636
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +0 -92
- package/dist/react-native/chunks/cold-module-N6KFNNZA.mjs +0 -773
- package/dist/react-native/chunks/durability-wiring-RN64S2TL.mjs +0 -4984
- package/dist/react-native/chunks/engine-hooks-CWA5CKCA.mjs +0 -30
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +0 -3
- package/dist/react-native/chunks/import-5UAWBRJP.mjs +0 -32
- package/dist/react-native/chunks/methods-6W5U4C3H.mjs +0 -30
- package/dist/react-native/chunks/module-6RP4ZCBW.mjs +0 -37
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +0 -5
- package/dist/react-native/chunks/phrase-module-QK22HSQ2.mjs +0 -329
- package/dist/react-native/chunks/pool-JR3NJCAF.mjs +0 -297
- package/dist/react-native/chunks/release-2SIHZWDO.mjs +0 -32
- package/dist/react-native/chunks/restore-hooks-ENFMDTWC.mjs +0 -127
- package/dist/react-native/chunks/restore-queue-4R6AASE5.mjs +0 -55
- package/dist/react-native/chunks/retention-5GTFT3GR.mjs +0 -223
- package/dist/react-native/chunks/snapshot-5LGPQXFS.mjs +0 -976
- package/dist/react-native/chunks/start-ZQJVZ5DN.mjs +0 -38
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +0 -15
- package/dist/react-native/chunks/write-6BRYIIZ7.mjs +0 -208
- package/dist/release-SMR4WJD4.mjs +0 -32
- package/dist/restore-hooks-HXLIEB4A.mjs +0 -153
- package/dist/restore-queue-LZH7LMLR.mjs +0 -55
- package/dist/retention-3K7ARGAG.mjs +0 -66
- package/dist/runtime-COIUORCN.mjs +0 -177
- package/dist/snapshot-O7ICP7NJ.mjs +0 -783
- package/dist/start-S4PFP6RS.mjs +0 -66
- package/dist/sync-state-ZWHLAFLE.mjs +0 -15
- package/dist/thread-YLJ3ZPQ3.mjs +0 -50
- package/dist/write-2OBJGLFS.mjs +0 -233
- /package/dist/browser/{chunk-M3MQE2X7.mjs → digest-leaf-64IPRPZD.mjs} +0 -0
- /package/dist/browser/{chunk-JNOAKDUM.mjs → gzip-JF3S6PPT.mjs} +0 -0
- /package/dist/{chunk-ZXNNR73R.mjs → gzip-2UCZW2MM.mjs} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AnyDocument, c as BM25FieldParams, B as BM25Params, E as EmbeddingFieldConfig,
|
|
1
|
+
import { e as StopWordOverride, C as CustomTokenizer } from './schema-C_7yRJLt.js';
|
|
2
|
+
export { A as AnyDocument, c as BM25FieldParams, B as BM25Params, E as EmbeddingFieldConfig, f as FieldOptionChain, F as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, d as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, b as VectorQuantizationMode, g as VectorStorageMode, W as WriteOptions } from './schema-C_7yRJLt.js';
|
|
3
3
|
import { P as PartialWordSearch } from './partial-words-DTIHO8G4.js';
|
|
4
4
|
import { P as PatternSearch } from './pattern-Cledccbl.js';
|
|
5
5
|
import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
import { h as Narsil } from './engine-
|
|
10
|
-
export { s as AdapterRegistrationOperations, A as AnalysisChange, t as AnalysisOperations, u as ArrayFilter, v as BM25Operations, B as BatchResult, w as ByteSource, C as ClientErrorCode, a as ClientErrorCodes, x as ComparisonFilter, D as DocumentImportResult, y as DocumentProjection, z as DocumentWriteOperations, E as ErrorCode, b as ErrorCodes, F as FacetConfig,
|
|
11
|
-
import { N as NarsilConfig } from './config-
|
|
12
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as MemoryConfig, d as NarsilPlugin, P as PartitionContext, Q as QuerySuggestionsConfig, R as RemoveContext, S as SearchContext, e as StaleAnalysis, U as UpdateContext, W as WorkerConfig, f as WorkerContext } from './config-
|
|
9
|
+
import { h as Narsil } from './engine-DBRVR_d-.js';
|
|
10
|
+
export { s as AdapterRegistrationOperations, A as AnalysisChange, t as AnalysisOperations, u as ArrayFilter, v as BM25Operations, B as BatchResult, w as ByteSource, C as ClientErrorCode, a as ClientErrorCodes, x as ComparisonFilter, D as DocumentImportResult, y as DocumentProjection, z as DocumentWriteOperations, E as ErrorCode, b as ErrorCodes, F as FacetConfig, J as FacetResult, K as FieldFilter, O as FilterExpression, R as GeoFilter, T as GeoPolygonFilter, U as GeoRadiusFilter, r as GroupConfig, W as GroupReducer, G as GroupResult, X as HeldCheckpointReport, Y as HighlightConfig, Z as HighlightMatch, H as Hit, _ as HybridConfig, I as IndexInfo, $ as IndexLifecycleOperations, p as IndexStats, L as ListParams, l as ListResult, a0 as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, k as NarsilEventHandlers, q as NarsilEventMap, P as PartitionStatsResult, o as PreflightResult, a1 as PresenceFilter, a2 as ProcessMemoryReport, a3 as QueryCoverage, Q as QueryParams, j as QueryResult, a4 as RerankConfig, a5 as ScoreComponents, a6 as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, e as SnapshotOptions, a7 as SortField, a8 as SortSpec, a9 as StringFilter, m as SuggestParams, n as SuggestResult, aa as SyncOperations, f as SyncSetting, g as SyncStatus, ab as SynonymOperations, ac as TermMatchPolicy, ad as VectorMaintenanceOperations, V as VectorMaintenanceResult, ae as VectorQueryConfig, af as WorkerCopyReport, i as isNarsilError } from './engine-DBRVR_d-.js';
|
|
11
|
+
import { N as NarsilConfig } from './config-_WT5grSL.js';
|
|
12
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as MemoryConfig, d as NarsilPlugin, P as PartitionContext, Q as QuerySuggestionsConfig, R as RemoveContext, S as SearchContext, e as StaleAnalysis, U as UpdateContext, W as WorkerConfig, f as WorkerContext } from './config-_WT5grSL.js';
|
|
13
|
+
import { N as NativeStoredValues } from './stored-values-BWIMpiT_.js';
|
|
13
14
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
14
15
|
export { h as QuerySuggestionsBuildEvent, j as QuerySuggestionsWarningEvent } from './query-suggestions-CBYkrQ5T.js';
|
|
15
16
|
|
|
@@ -84,75 +85,897 @@ declare function getTokenizer(name: string): CustomTokenizer;
|
|
|
84
85
|
*/
|
|
85
86
|
declare function getStopWords(name: string): StopWordOverride;
|
|
86
87
|
|
|
88
|
+
/** The regions of a growing UTF-16 term dictionary. @internal */
|
|
89
|
+
interface NativeTermTable {
|
|
90
|
+
/** The eight-word header containing counts, slot capacity, generation, and used text units. */
|
|
91
|
+
header: Uint32Array;
|
|
92
|
+
/** The hash slots containing ordinal plus one, zero for empty, or minus one for removed. */
|
|
93
|
+
slots: Int32Array;
|
|
94
|
+
/** The text start of each term. */
|
|
95
|
+
termOffset: Uint32Array;
|
|
96
|
+
/** The UTF-16 length of each term. */
|
|
97
|
+
termLength: Uint32Array;
|
|
98
|
+
/** The next term with the same first unit, plus one, or zero. */
|
|
99
|
+
firstUnitNext: Uint32Array;
|
|
100
|
+
/** The first term for each of the 65,536 possible first units, plus one, or zero. */
|
|
101
|
+
firstUnitHead: Uint32Array;
|
|
102
|
+
/** The UTF-16 units of the terms. */
|
|
103
|
+
units: Uint16Array;
|
|
104
|
+
}
|
|
105
|
+
/** The regions and live counts of a growing or frozen term dictionary. @internal */
|
|
106
|
+
interface NativeTermDictionary {
|
|
107
|
+
/** The growing table, or null for a frozen dictionary. */
|
|
108
|
+
growing: NativeTermTable | null;
|
|
109
|
+
/** The frozen UTF-8 tokens, empty for a growing dictionary. */
|
|
110
|
+
tokens: Uint8Array;
|
|
111
|
+
/** The frozen token offsets and final byte length, empty for a growing dictionary. */
|
|
112
|
+
offsets: Uint32Array;
|
|
113
|
+
/** The stored document frequency at each term ordinal. */
|
|
114
|
+
frequencies: Uint32Array;
|
|
115
|
+
/** The removed document count at each term ordinal. */
|
|
116
|
+
removed: Uint32Array;
|
|
117
|
+
}
|
|
118
|
+
/** The native dictionary operations that preserve live counts and Unicode order. @internal */
|
|
119
|
+
interface NativeTermCore {
|
|
120
|
+
/**
|
|
121
|
+
* Finds an exact live term.
|
|
122
|
+
* @param dictionary - The term regions and removal counts.
|
|
123
|
+
* @param text - The UTF-16 query term.
|
|
124
|
+
* @param output - Receives the ordinal when the term is present.
|
|
125
|
+
* @returns Zero or one, or a negative status that leaves the output unchanged.
|
|
126
|
+
*/
|
|
127
|
+
lookupExact(dictionary: NativeTermDictionary, text: Uint16Array, output: Uint32Array): number;
|
|
128
|
+
/**
|
|
129
|
+
* Finds each exact live term after validating the dictionary once.
|
|
130
|
+
* @param dictionary - The term regions and removal counts.
|
|
131
|
+
* @param units - The concatenated UTF-16 query terms.
|
|
132
|
+
* @param offsets - The nondecreasing term boundaries, starting at zero and ending at the unit count.
|
|
133
|
+
* @param output - Receives each term ordinal, or UINT32_MAX when absent.
|
|
134
|
+
* @returns The query count, or a negative status that leaves the entire output unchanged.
|
|
135
|
+
*/
|
|
136
|
+
lookupExactBatch(dictionary: NativeTermDictionary, units: Uint16Array, offsets: Uint32Array, output: Uint32Array): number;
|
|
137
|
+
/**
|
|
138
|
+
* Finds live prefix matches in descending frequency and then code point order.
|
|
139
|
+
* @param dictionary - The term regions and removal counts.
|
|
140
|
+
* @param text - The UTF-16 prefix, which matches nothing when empty.
|
|
141
|
+
* @param limit - The maximum number of matches.
|
|
142
|
+
* @param output - Receives the matching ordinals.
|
|
143
|
+
* @returns The match count, or a negative status that leaves the output unchanged.
|
|
144
|
+
*/
|
|
145
|
+
lookupPrefix(dictionary: NativeTermDictionary, text: Uint16Array, limit: number, output: Uint32Array): number;
|
|
146
|
+
/**
|
|
147
|
+
* Finds live terms within the edit distance in code point order.
|
|
148
|
+
* @param dictionary - The term regions and removal counts.
|
|
149
|
+
* @param text - The UTF-16 query term.
|
|
150
|
+
* @param tolerance - The maximum Levenshtein distance, or zero for an exact lookup.
|
|
151
|
+
* @param prefixLength - The number of leading query code points that must match.
|
|
152
|
+
* @param output - Receives the matching ordinals.
|
|
153
|
+
* @returns The match count, or a negative status that leaves the output unchanged.
|
|
154
|
+
*/
|
|
155
|
+
lookupTypo(dictionary: NativeTermDictionary, text: Uint16Array, tolerance: number, prefixLength: number, output: Uint32Array): number;
|
|
156
|
+
/**
|
|
157
|
+
* Writes the live document frequency of a term.
|
|
158
|
+
* @param dictionary - The term regions and removal counts.
|
|
159
|
+
* @param ordinal - The term ordinal.
|
|
160
|
+
* @param output - Receives the frequency in its first word.
|
|
161
|
+
* @returns Zero, or a negative status that leaves the output unchanged.
|
|
162
|
+
*/
|
|
163
|
+
documentFrequency(dictionary: NativeTermDictionary, ordinal: number, output: Uint32Array): number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** The allocator regions for posting slices and run membership lists. @internal */
|
|
167
|
+
interface NativeSliceAllocator {
|
|
168
|
+
/** The used end and the number of free entries. */
|
|
169
|
+
allocation: Uint32Array;
|
|
170
|
+
/** The first free slice for each class, or UINT32_MAX. */
|
|
171
|
+
freeHeads: Uint32Array;
|
|
172
|
+
/** The strictly increasing capacity of each slice class. */
|
|
173
|
+
sliceCapacities: Uint32Array;
|
|
174
|
+
}
|
|
175
|
+
/** The posting metadata indexed by term ordinal. @internal */
|
|
176
|
+
interface NativeTermColumns {
|
|
177
|
+
/** The first posting of each term's slice. */
|
|
178
|
+
sliceStart: Uint32Array;
|
|
179
|
+
/** The allocated slice class of each term. */
|
|
180
|
+
sliceClass: Uint8Array;
|
|
181
|
+
/** The number of occupied entries in each slice. */
|
|
182
|
+
lengths: Uint32Array;
|
|
183
|
+
/** The stored document count of each term. */
|
|
184
|
+
docFrequency: Uint32Array;
|
|
185
|
+
/** The removed document count of each term. */
|
|
186
|
+
deadDocuments: Uint32Array;
|
|
187
|
+
/** The sum of the live, capped posting frequencies. */
|
|
188
|
+
totalTermFrequency: Float64Array;
|
|
189
|
+
/** The sum of the live surface counts for each term. */
|
|
190
|
+
surfaceOccurrences: Float64Array;
|
|
191
|
+
/** The revision that invalidates each term's cached posting view. */
|
|
192
|
+
revision: Uint32Array;
|
|
193
|
+
/** The live, ordered, and position flags, in bits zero, one, and two. */
|
|
194
|
+
flags: Uint8Array;
|
|
195
|
+
}
|
|
196
|
+
/** The shared posting columns and their slice allocator. @internal */
|
|
197
|
+
interface NativePostingPool extends NativeSliceAllocator {
|
|
198
|
+
/** The document ordinal at each posting. */
|
|
199
|
+
docIds: Uint32Array;
|
|
200
|
+
/** The capped frequency at each posting. */
|
|
201
|
+
frequencies: Uint16Array;
|
|
202
|
+
/** The field ordinal at each posting. */
|
|
203
|
+
fieldIndices: Uint16Array;
|
|
204
|
+
/** The first position entry for each posting, or null when positions are absent. */
|
|
205
|
+
positionStarts: Uint32Array | null;
|
|
206
|
+
}
|
|
207
|
+
/** The position lists and their allocation metadata. @internal */
|
|
208
|
+
interface NativePositionPool {
|
|
209
|
+
/** Each list's length followed by its positions, with word zero reserved for an empty list. */
|
|
210
|
+
values: Uint32Array;
|
|
211
|
+
/** The used end and the number of free words. */
|
|
212
|
+
allocation: Uint32Array;
|
|
213
|
+
}
|
|
214
|
+
/** The surface strings and their live counts. @internal */
|
|
215
|
+
interface NativeSurfaceTable {
|
|
216
|
+
/** The surface dictionary. */
|
|
217
|
+
strings: NativeTermTable;
|
|
218
|
+
/** The term ordinal associated with each surface. */
|
|
219
|
+
token: Uint32Array;
|
|
220
|
+
/** The occurrence count of each surface within this segment. */
|
|
221
|
+
count: Uint32Array;
|
|
222
|
+
}
|
|
223
|
+
/** The three-code-point runs and their spelling membership lists. @internal */
|
|
224
|
+
interface NativeRunTable extends NativeSliceAllocator {
|
|
225
|
+
/** The eight-word header, with the run count at zero and slot capacity at two. */
|
|
226
|
+
header: Uint32Array;
|
|
227
|
+
/** The run ordinal plus one, zero for an empty slot, or minus one for a removed slot. */
|
|
228
|
+
slots: Int32Array;
|
|
229
|
+
/** Three consecutive code points for each run. */
|
|
230
|
+
runs: Uint32Array;
|
|
231
|
+
/** The start of each run's member slice. */
|
|
232
|
+
listStart: Uint32Array;
|
|
233
|
+
/** The number of members in each run. */
|
|
234
|
+
listLength: Uint32Array;
|
|
235
|
+
/** The allocated slice class of each run. */
|
|
236
|
+
listClass: Uint8Array;
|
|
237
|
+
/** The spelling ordinals, in ascending order within each run. */
|
|
238
|
+
members: Uint32Array;
|
|
239
|
+
}
|
|
240
|
+
/** The written spellings used for partial-word search. @internal */
|
|
241
|
+
interface NativeSpellingTable extends NativeSurfaceTable {
|
|
242
|
+
/** The length in code points of each spelling. */
|
|
243
|
+
codePoints: Uint32Array;
|
|
244
|
+
/** The runs that locate spellings containing a query fragment. */
|
|
245
|
+
runs: NativeRunTable;
|
|
246
|
+
}
|
|
247
|
+
/** The mutable keyword regions of one segment, protected by its copy's publication gate. @internal */
|
|
248
|
+
interface NativeGrowingSegment {
|
|
249
|
+
/** The term dictionary. */
|
|
250
|
+
terms: NativeTermTable;
|
|
251
|
+
/** The term posting metadata. */
|
|
252
|
+
columns: NativeTermColumns;
|
|
253
|
+
/** The posting columns and their allocator. */
|
|
254
|
+
postings: NativePostingPool;
|
|
255
|
+
/** The position lists, or null when the segment does not track positions. */
|
|
256
|
+
positions: NativePositionPool | null;
|
|
257
|
+
/** The surface table, or null when no token has a separate surface. */
|
|
258
|
+
surfaces: NativeSurfaceTable | null;
|
|
259
|
+
/** The spelling table, or null when the segment has no partial-word field. */
|
|
260
|
+
spellings: NativeSpellingTable | null;
|
|
261
|
+
/** The retired document ordinals as a uint32 bitset. */
|
|
262
|
+
retired: Uint32Array;
|
|
263
|
+
/** The field lengths in field-major order, with ordinalCapacity words per field. */
|
|
264
|
+
fieldLengths: Uint32Array;
|
|
265
|
+
/** The single-word live document count. */
|
|
266
|
+
totalDocuments: Uint32Array;
|
|
267
|
+
/** The live field length totals, indexed by field. */
|
|
268
|
+
totalFieldLengths: Float64Array;
|
|
269
|
+
/** One for a partial-word field, or zero, with one byte per field. */
|
|
270
|
+
partialFields: Uint8Array;
|
|
271
|
+
/** The document ordinal capacity of the segment. */
|
|
272
|
+
ordinalCapacity: number;
|
|
273
|
+
}
|
|
274
|
+
/** The prepared tokens of one text field, including an empty token region. @internal */
|
|
275
|
+
interface NativeFieldTokens {
|
|
276
|
+
/** The field ordinal, in ascending order across the request. */
|
|
277
|
+
field: number;
|
|
278
|
+
/** The eight-word token records returned by native analysis. */
|
|
279
|
+
tokens: Uint32Array;
|
|
280
|
+
/** The UTF-16 text referenced by the token records. */
|
|
281
|
+
units: Uint16Array;
|
|
282
|
+
}
|
|
87
283
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* The engine holds every index you create, so an application usually keeps one
|
|
92
|
-
* instance for its lifetime. When you configure persistence, this recovers the
|
|
93
|
-
* indexes already on disk before it resolves. Lifecycle settings register
|
|
94
|
-
* those indexes as closed and load each one when its first request arrives.
|
|
95
|
-
*
|
|
96
|
-
* @param config - This carries the persistence, partitioning, and worker
|
|
97
|
-
* invalidation settings. Omit it for an engine that keeps everything in memory.
|
|
98
|
-
* @returns The engine, ready for {@link Narsil.createIndex} to run against.
|
|
99
|
-
*
|
|
100
|
-
* @public
|
|
284
|
+
* One value of a field passed by position: the field ordinal, then its token records, then its UTF-16 text,
|
|
285
|
+
* repeated once for each field in ascending field order. @internal
|
|
101
286
|
*/
|
|
102
|
-
|
|
287
|
+
type NativeFieldTokenArgument = number | Uint32Array | Uint16Array;
|
|
288
|
+
/** The operations that publish complete documents into keyword segments. @internal */
|
|
289
|
+
interface NativeSegmentCore {
|
|
290
|
+
/**
|
|
291
|
+
* Adds all the indexed text fields and the document count in one publication.
|
|
292
|
+
* @param segment - The writable keyword regions of one growing segment.
|
|
293
|
+
* @param generation - A positive integer that changes whenever the segment replaces any of its regions, so the
|
|
294
|
+
* binding reads every region again only when it changes.
|
|
295
|
+
* @param ordinal - The document ordinal, below the segment's capacity.
|
|
296
|
+
* @param fields - Each prepared field as its ordinal, token records, and text, present at most once in
|
|
297
|
+
* ascending field order.
|
|
298
|
+
* @returns Zero on success, three when a region needs room, eight when a count requires a new segment,
|
|
299
|
+
* or another positive core status on refusal. Every nonzero status leaves all regions unchanged.
|
|
300
|
+
*/
|
|
301
|
+
indexTerms(segment: NativeGrowingSegment, generation: number, ordinal: number, ...fields: readonly NativeFieldTokenArgument[]): number;
|
|
302
|
+
/**
|
|
303
|
+
* Removes one document's keyword counts, surfaces, spellings, and field lengths.
|
|
304
|
+
* @param segment - The writable keyword regions of one growing segment.
|
|
305
|
+
* @param generation - The segment's region generation, as {@link NativeSegmentCore.indexTerms} describes it.
|
|
306
|
+
* @param ordinal - The document ordinal, below the segment's capacity.
|
|
307
|
+
* @param fields - Each of the document's analysed fields as its ordinal, token records, and text, in
|
|
308
|
+
* ascending field order.
|
|
309
|
+
* @returns Zero on success, including an ordinal already retired, or a positive core status on refusal.
|
|
310
|
+
* Every refusal leaves all regions unchanged.
|
|
311
|
+
*/
|
|
312
|
+
removeDocument(segment: NativeGrowingSegment, generation: number, ordinal: number, ...fields: readonly NativeFieldTokenArgument[]): number;
|
|
313
|
+
/**
|
|
314
|
+
* Compacts retired posting rows before a batch of writes.
|
|
315
|
+
* @param segment - The writable keyword regions of one growing segment.
|
|
316
|
+
* @param generation - The segment's region generation, as {@link NativeSegmentCore.indexTerms} describes it.
|
|
317
|
+
* @returns Zero on success, or a positive core status with every region unchanged on refusal.
|
|
318
|
+
*/
|
|
319
|
+
beginBatch(segment: NativeGrowingSegment, generation: number): number;
|
|
320
|
+
/**
|
|
321
|
+
* Compacts retired posting rows after a batch while preserving live counts and retired ordinals.
|
|
322
|
+
* @param segment - The writable keyword regions of one growing segment.
|
|
323
|
+
* @param generation - The segment's region generation, as {@link NativeSegmentCore.indexTerms} describes it.
|
|
324
|
+
* @returns Zero on success, or a positive core status with every region unchanged on refusal.
|
|
325
|
+
*/
|
|
326
|
+
endBatch(segment: NativeGrowingSegment, generation: number): number;
|
|
327
|
+
}
|
|
103
328
|
|
|
104
329
|
/**
|
|
105
|
-
*
|
|
106
|
-
* create and load an index with a field whose type includes `partial`.
|
|
107
|
-
*
|
|
108
|
-
* A Node process loads that code by itself, so only a browser app has to
|
|
109
|
-
* make this call. In a browser, import `partialWordSearch` from
|
|
110
|
-
* `@delali/narsil/partial-words` and pass it here before the app creates or
|
|
111
|
-
* loads an index with a `partial` field.
|
|
330
|
+
* The native operations that group hits and combine grouped search results.
|
|
112
331
|
*
|
|
113
|
-
* @
|
|
114
|
-
* `@delali/narsil/partial-words` exports.
|
|
115
|
-
* @throws The engine throws a `NarsilError` with `CONFIG_INVALID` for any
|
|
116
|
-
* other object.
|
|
117
|
-
*
|
|
118
|
-
* @public
|
|
332
|
+
* @internal
|
|
119
333
|
*/
|
|
120
|
-
|
|
334
|
+
interface NativeGroupCore {
|
|
335
|
+
/**
|
|
336
|
+
* Groups hits by stored field equality and orders groups by their first member's score and document ID.
|
|
337
|
+
*
|
|
338
|
+
* @param values - The stored fields in grouping order, all using the same ordinal space.
|
|
339
|
+
* @param ordinals - The stored ordinal at each input hit position, in final hit order.
|
|
340
|
+
* @param scores - The score at each input hit position, with zero for an absent score.
|
|
341
|
+
* @param idRanks - The document ID rank at each input hit position, in code point order.
|
|
342
|
+
* @param maxPerGroup - The maximum number of retained hits in each group.
|
|
343
|
+
* @param limit - The maximum number of groups, or null to retain every group.
|
|
344
|
+
* @param outHeads - Receives each group's first input hit position, including when maxPerGroup is zero.
|
|
345
|
+
* @param outOffsets - Receives each group's first retained hit offset and the terminal offset, or one zero for no groups.
|
|
346
|
+
* @param outHits - Receives the retained input hit positions in their incoming order within each group.
|
|
347
|
+
* @param outMembers - Receives each group's full member count before truncation.
|
|
348
|
+
* @returns The group count, or a negative core status that leaves inputs and output regions unchanged.
|
|
349
|
+
*/
|
|
350
|
+
groupHits(values: readonly NativeStoredValues[], ordinals: Uint32Array, scores: Float64Array, idRanks: Uint32Array, maxPerGroup: number, limit: number | null, outHeads: Uint32Array, outOffsets: Uint32Array, outHits: Uint32Array, outMembers: Uint32Array): number;
|
|
351
|
+
/**
|
|
352
|
+
* Merges each group's entries and orders groups by their first retained score and document ID.
|
|
353
|
+
*
|
|
354
|
+
* @param keys - Group identities in source-list order, with repeated identities combined.
|
|
355
|
+
* @param offsets - Each input group's first entry, followed by the total entry count.
|
|
356
|
+
* @param scores - Raw entry scores, or null when every score is absent.
|
|
357
|
+
* @param scorePresent - Bits marking present scores, or null when every supplied score is present.
|
|
358
|
+
* @param ranks - Cross-list entry ranks by sort values and document ID when sorted, or by document ID otherwise.
|
|
359
|
+
* @param idRanks - Cross-list document ID ranks in code point order.
|
|
360
|
+
* @param sorted - Whether ranks determine entry order independently of scores.
|
|
361
|
+
* @param maxPerGroup - The maximum number of entries retained in each group.
|
|
362
|
+
* @param limit - The maximum number of groups returned, or null to retain every group.
|
|
363
|
+
* @param outKeys - Receives the retained group identities in result order.
|
|
364
|
+
* @param outOffsets - Receives each output group's first entry and the final entry count, or one zero for no groups.
|
|
365
|
+
* @param outSources - Receives each retained entry's input group position.
|
|
366
|
+
* @param outIndices - Receives each retained entry's position within its input group.
|
|
367
|
+
* @returns The group count, or a negative core status that leaves inputs and output regions unchanged.
|
|
368
|
+
*/
|
|
369
|
+
mergeGroups(keys: Uint32Array, offsets: Uint32Array, scores: Float64Array | null, scorePresent: Uint32Array | null, ranks: Uint32Array, idRanks: Uint32Array, sorted: boolean, maxPerGroup: number, limit: number | null, outKeys: Uint32Array, outOffsets: Uint32Array, outSources: Uint32Array, outIndices: Uint32Array): number;
|
|
370
|
+
}
|
|
121
371
|
|
|
372
|
+
/** An open read-only file that the core retains until its last operation finishes. @internal */
|
|
373
|
+
interface NativePagedFileHandle {
|
|
374
|
+
/** The stable identity that distinguishes this open file from every other handle. */
|
|
375
|
+
readonly identity: bigint;
|
|
376
|
+
/** The file length in bytes when the core opened it. */
|
|
377
|
+
readonly length: bigint;
|
|
378
|
+
}
|
|
379
|
+
/** The page storage and lookup regions that one searching thread owns. @internal */
|
|
380
|
+
interface NativePageCache {
|
|
381
|
+
/** The page slots, each occupying 65,536 bytes. */
|
|
382
|
+
bytes: Uint8Array;
|
|
383
|
+
/** The stable file identity of each slot, or zero for an unused slot. */
|
|
384
|
+
files: BigUint64Array;
|
|
385
|
+
/** The absolute section offset of each slot. */
|
|
386
|
+
offsets: BigUint64Array;
|
|
387
|
+
/** The page number within the section of each slot. */
|
|
388
|
+
pages: BigUint64Array;
|
|
389
|
+
/** The number of valid bytes in each slot. */
|
|
390
|
+
lengths: Uint32Array;
|
|
391
|
+
/** The expected CRC32 of each slot. */
|
|
392
|
+
checksums: Uint32Array;
|
|
393
|
+
}
|
|
394
|
+
/** The location and page checksums of one section in an open file. @internal */
|
|
395
|
+
interface NativePageSection {
|
|
396
|
+
/** The file that holds the section. */
|
|
397
|
+
file: NativePagedFileHandle;
|
|
398
|
+
/** The absolute byte offset from the start of the file. */
|
|
399
|
+
offset: bigint;
|
|
400
|
+
/** The section length in bytes. */
|
|
401
|
+
length: bigint;
|
|
402
|
+
/** The page length, either 16,384 or 65,536 bytes. */
|
|
403
|
+
pageBytes: number;
|
|
404
|
+
/** One little-endian uint32 CRC32 for each page. */
|
|
405
|
+
checksums: Uint8Array;
|
|
406
|
+
}
|
|
407
|
+
/** The vector rows and deletion bits of one file within a field. @internal */
|
|
408
|
+
interface NativePagedVectorFile {
|
|
409
|
+
/** The first global vector number in the file. */
|
|
410
|
+
first: number;
|
|
411
|
+
/** The number of vectors in the file. */
|
|
412
|
+
count: number;
|
|
413
|
+
/** The manifest's local deletion bits in bytes, or null when every vector is live. */
|
|
414
|
+
dead: Uint8Array | null;
|
|
415
|
+
/** The full-precision float32 vector rows. */
|
|
416
|
+
vectors: NativePageSection;
|
|
417
|
+
/** The packed OSQ records, or null for an unquantised field. */
|
|
418
|
+
records: NativePageSection | null;
|
|
419
|
+
}
|
|
420
|
+
/** The resident node metadata and paged neighbour lists of one graph part. @internal */
|
|
421
|
+
interface NativePagedGraphPart {
|
|
422
|
+
/** The first global vector number in the part. */
|
|
423
|
+
first: number;
|
|
424
|
+
/** The number of vector positions in the part. */
|
|
425
|
+
count: number;
|
|
426
|
+
/** Each node's number of layers, with zero for a missing node. */
|
|
427
|
+
levels: Uint8Array;
|
|
428
|
+
/** Each node's byte offset in neighbours, followed by the end of the last node. */
|
|
429
|
+
nodeOffsets: Uint32Array;
|
|
430
|
+
/** The counted uint32 neighbour lists. */
|
|
431
|
+
neighbours: NativePageSection;
|
|
432
|
+
}
|
|
433
|
+
/** The files and graph parts that describe one disk vector field. @internal */
|
|
434
|
+
interface NativePagedVectorField {
|
|
435
|
+
/** The number of float32 components in each vector. */
|
|
436
|
+
dimension: number;
|
|
437
|
+
/** Zero for cosine, one for dot product, or two for Euclidean distance. */
|
|
438
|
+
metric: number;
|
|
439
|
+
/** The number of vector positions across every file. */
|
|
440
|
+
total: number;
|
|
441
|
+
/** The first node to visit, or null to choose a node on the highest layer. */
|
|
442
|
+
entryPoint: number | null;
|
|
443
|
+
/** The highest permitted layer in the field. */
|
|
444
|
+
maxLayer: number;
|
|
445
|
+
/** The OSQ width and centroid, or null for full-precision traversal. */
|
|
446
|
+
codes: {
|
|
447
|
+
bits: number;
|
|
448
|
+
centroid: Float32Array;
|
|
449
|
+
} | null;
|
|
450
|
+
/** The vector files in gap-free global vector order. */
|
|
451
|
+
files: readonly NativePagedVectorFile[];
|
|
452
|
+
/** The graph parts in gap-free global vector order. */
|
|
453
|
+
graphParts: readonly NativePagedGraphPart[];
|
|
454
|
+
}
|
|
455
|
+
/** The resolved search settings and admission masks of a paged vector query. @internal */
|
|
456
|
+
interface NativePagedVectorRequest {
|
|
457
|
+
/** The finite float32 query components. */
|
|
458
|
+
query: Float32Array;
|
|
459
|
+
/** The result count before the host resolves document ID ties. */
|
|
460
|
+
k: number;
|
|
461
|
+
/** The number of candidates that the graph walk retains. */
|
|
462
|
+
ef: number;
|
|
463
|
+
/** The number of quantised candidates to score with full-precision vectors. */
|
|
464
|
+
rescoreDepth: number;
|
|
465
|
+
/** Whether the caller supplied a rescore window. */
|
|
466
|
+
explicitRescoreWindow: boolean;
|
|
467
|
+
/** The numeric score floor, including negative infinity. */
|
|
468
|
+
minSimilarity: number;
|
|
469
|
+
/** The admitted global vector numbers in uint32 words, or null for every live vector. */
|
|
470
|
+
accepted: Uint32Array | null;
|
|
471
|
+
/** The excluded global vector numbers in uint32 words, or null for none. */
|
|
472
|
+
excluded: Uint32Array | null;
|
|
473
|
+
}
|
|
474
|
+
/** The core operations that read checksummed pages and search disk vector fields. @internal */
|
|
475
|
+
interface NativePagedCore {
|
|
476
|
+
/**
|
|
477
|
+
* Opens an immutable file for positional reads.
|
|
478
|
+
* @param path - The path of the file to open.
|
|
479
|
+
* @returns The open handle, or a negative status when the file cannot be opened.
|
|
480
|
+
*/
|
|
481
|
+
openPagedFile(path: string): NativePagedFileHandle | number;
|
|
482
|
+
/**
|
|
483
|
+
* Releases an open handle after every operation that uses it has finished.
|
|
484
|
+
* @param file - The handle to close.
|
|
485
|
+
* @returns Zero on success, or a negative status for an invalid handle.
|
|
486
|
+
*/
|
|
487
|
+
closePagedFile(file: NativePagedFileHandle): number;
|
|
488
|
+
/**
|
|
489
|
+
* Copies one verified page into the supplied output.
|
|
490
|
+
* @param section - The file section to read.
|
|
491
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
492
|
+
* @param page - The page number within the section.
|
|
493
|
+
* @param output - Receives the page bytes only after its checksum passes.
|
|
494
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
495
|
+
* @returns Zero on success, or a negative status that leaves output unchanged.
|
|
496
|
+
*/
|
|
497
|
+
readPage(section: NativePageSection, cache: NativePageCache | null, page: bigint, output: Uint8Array, fault: BigUint64Array): number;
|
|
498
|
+
/**
|
|
499
|
+
* Reads a verified page on a background thread while retaining its file until completion.
|
|
500
|
+
* @param section - The file section, whose checksums the core copies before reading.
|
|
501
|
+
* @param cache - An exclusively held cache with shared buffers, or null.
|
|
502
|
+
* @param page - The page number within the section.
|
|
503
|
+
* @param output - Shared bytes that receive the page after its checksum passes.
|
|
504
|
+
* @param fault - Three shared uint64 words for the file identity, section offset, and page number.
|
|
505
|
+
* @returns Zero on success, or a negative status, immediately on refusal or after completion.
|
|
506
|
+
* A refusal leaves output unchanged.
|
|
507
|
+
*/
|
|
508
|
+
readPageAsync(section: NativePageSection, cache: NativePageCache | null, page: bigint, output: Uint8Array, fault: BigUint64Array): number | Promise<number>;
|
|
509
|
+
/**
|
|
510
|
+
* Copies a posting list after checking its pages, ordinals, fields, and order.
|
|
511
|
+
* @param section - The paged postings section.
|
|
512
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
513
|
+
* @param first - The list's first posting offset.
|
|
514
|
+
* @param count - The number of postings in the list.
|
|
515
|
+
* @param documents - The segment's document count.
|
|
516
|
+
* @param fields - The segment's field count.
|
|
517
|
+
* @param output - Receives little-endian document, frequency, and field columns, occupying eight bytes per posting.
|
|
518
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
519
|
+
* @returns Zero on success, or a negative status that leaves output unchanged.
|
|
520
|
+
*/
|
|
521
|
+
readPagedPostings(section: NativePageSection, cache: NativePageCache | null, first: number, count: number, documents: number, fields: number, output: Uint8Array, fault: BigUint64Array): number;
|
|
522
|
+
/**
|
|
523
|
+
* Reads a posting list's positions and rebases its offsets to the returned values.
|
|
524
|
+
* @param offsetSection - The section that holds absolute position offsets.
|
|
525
|
+
* @param valueSection - The section that holds the uint32 positions.
|
|
526
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
527
|
+
* @param first - The first posting whose positions to read.
|
|
528
|
+
* @param count - The number of postings to read.
|
|
529
|
+
* @param offsets - Receives count plus one offsets relative to values.
|
|
530
|
+
* @param values - Receives the positions after the core checks each posting's order.
|
|
531
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
532
|
+
* @returns Zero on success, or a negative status that leaves both output arrays unchanged.
|
|
533
|
+
*/
|
|
534
|
+
readPagedPositions(offsetSection: NativePageSection, valueSection: NativePageSection, cache: NativePageCache | null, first: number, count: number, offsets: Uint32Array, values: Uint32Array, fault: BigUint64Array): number;
|
|
535
|
+
/**
|
|
536
|
+
* Reads the sorted token and frequency pairs for one removed document.
|
|
537
|
+
* @param offsetSection - The section that holds the document offsets in uint32 words.
|
|
538
|
+
* @param valueSection - The section that holds token and frequency pairs.
|
|
539
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
540
|
+
* @param ordinal - The document ordinal within the segment.
|
|
541
|
+
* @param tokens - The segment's token count.
|
|
542
|
+
* @param values - Receives the token and frequency pairs after every check passes.
|
|
543
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
544
|
+
* @returns The number of uint32 words written, or a negative status that leaves values unchanged.
|
|
545
|
+
*/
|
|
546
|
+
readPagedRemovals(offsetSection: NativePageSection, valueSection: NativePageSection, cache: NativePageCache | null, ordinal: number, tokens: number, values: Uint32Array, fault: BigUint64Array): number;
|
|
547
|
+
/**
|
|
548
|
+
* Reads one document ID after checking its offsets, pages, and UTF-8 bytes.
|
|
549
|
+
* @param offsetSection - The uint32 offsets into the ID section.
|
|
550
|
+
* @param valueSection - The section that holds the UTF-8 IDs.
|
|
551
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
552
|
+
* @param ordinal - The document ordinal within the segment.
|
|
553
|
+
* @param output - Receives the ID bytes after every check passes.
|
|
554
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
555
|
+
* @returns The ID length in bytes, or a negative status that leaves output unchanged.
|
|
556
|
+
*/
|
|
557
|
+
readPagedId(offsetSection: NativePageSection, valueSection: NativePageSection, cache: NativePageCache | null, ordinal: number, output: Uint8Array, fault: BigUint64Array): number;
|
|
558
|
+
/**
|
|
559
|
+
* Reads one ordinal from an ID order after checking its page and document range.
|
|
560
|
+
* @param section - The section that holds one uint32 ordinal per document.
|
|
561
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
562
|
+
* @param position - The position within the ID order.
|
|
563
|
+
* @param documents - The segment's document count.
|
|
564
|
+
* @param output - Receives the ordinal in its first uint32 word.
|
|
565
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
566
|
+
* @returns Zero on success, or a negative status that leaves output unchanged.
|
|
567
|
+
*/
|
|
568
|
+
readPagedOrdinal(section: NativePageSection, cache: NativePageCache | null, position: number, documents: number, output: Uint32Array, fault: BigUint64Array): number;
|
|
569
|
+
/**
|
|
570
|
+
* Reads finite, non-negative term totals after checking every requested page.
|
|
571
|
+
* @param section - The section that holds one float64 total per token.
|
|
572
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
573
|
+
* @param first - The first token whose total to read.
|
|
574
|
+
* @param count - The number of consecutive totals to read.
|
|
575
|
+
* @param output - Receives the totals after every value passes validation.
|
|
576
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
577
|
+
* @returns Zero on success, or a negative status that leaves output unchanged.
|
|
578
|
+
*/
|
|
579
|
+
readPagedTotals(section: NativePageSection, cache: NativePageCache | null, first: number, count: number, output: Float64Array, fault: BigUint64Array): number;
|
|
580
|
+
/**
|
|
581
|
+
* Reads a document's sequence number and primary term after checking both pages.
|
|
582
|
+
* @param sequences - The section that holds the uint64 sequence numbers.
|
|
583
|
+
* @param terms - The section that holds the uint64 primary terms.
|
|
584
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
585
|
+
* @param ordinal - The document ordinal within the segment.
|
|
586
|
+
* @param output - Receives the sequence number and primary term in its first two words.
|
|
587
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
588
|
+
* @returns Zero on success, or a negative status that leaves output unchanged.
|
|
589
|
+
*/
|
|
590
|
+
readPagedWriteRecord(sequences: NativePageSection, terms: NativePageSection, cache: NativePageCache | null, ordinal: number, output: BigUint64Array, fault: BigUint64Array): number;
|
|
591
|
+
/**
|
|
592
|
+
* Searches a paged graph and retains every score tie at the requested cutoff.
|
|
593
|
+
* @param field - The resident metadata and open file sections.
|
|
594
|
+
* @param request - The query, resolved search settings, and admission masks.
|
|
595
|
+
* @param cache - The calling thread's page cache, or null to retain no pages.
|
|
596
|
+
* @param meter - The shared int64 work count followed by its cap.
|
|
597
|
+
* @param stop - One uint32 that becomes one when the search stops.
|
|
598
|
+
* @param deadline - One uint64 monotonic deadline, or zero for none.
|
|
599
|
+
* @param ordinals - Receives the selected global vector numbers.
|
|
600
|
+
* @param scores - Receives their relevance scores in descending score order.
|
|
601
|
+
* @param fault - Receives the file identity, section offset, and page number on a page failure.
|
|
602
|
+
* @returns The candidate count, or a negative status. Page failures, invalid arguments, allocation failures,
|
|
603
|
+
* and short outputs preserve both candidate arrays. A stop or work-cap status leaves their contents undefined.
|
|
604
|
+
*/
|
|
605
|
+
searchPagedVectors(field: NativePagedVectorField, request: NativePagedVectorRequest, cache: NativePageCache | null, meter: BigInt64Array, stop: Uint32Array, deadline: BigUint64Array, ordinals: Uint32Array, scores: Float64Array, fault: BigUint64Array): number;
|
|
606
|
+
/**
|
|
607
|
+
* Searches disk vectors on a background thread while retaining the file handles until completion.
|
|
608
|
+
* @param field - The resident metadata and open files, copied before the background search starts.
|
|
609
|
+
* @param request - The query and admission regions, copied before the background search starts.
|
|
610
|
+
* @param cache - An exclusively held cache whose regions use shared buffers, or null.
|
|
611
|
+
* @param meter - The shared int64 work count followed by its cap.
|
|
612
|
+
* @param stop - One shared uint32 that the caller can set atomically to stop the search.
|
|
613
|
+
* @param deadline - One uint64 monotonic deadline, copied before the background search starts.
|
|
614
|
+
* @param ordinals - A shared output region for selected global vector numbers.
|
|
615
|
+
* @param scores - A shared output region for their scores.
|
|
616
|
+
* @param fault - Three shared uint64 words for the file identity, section offset, and page number.
|
|
617
|
+
* @returns The candidate count or a negative status, immediately on refusal or after completion.
|
|
618
|
+
* Candidate output follows the same preservation rules as {@link NativePagedCore.searchPagedVectors}.
|
|
619
|
+
*/
|
|
620
|
+
searchPagedVectorsAsync(field: NativePagedVectorField, request: NativePagedVectorRequest, cache: NativePageCache | null, meter: BigInt64Array, stop: Uint32Array, deadline: BigUint64Array, ordinals: Uint32Array, scores: Float64Array, fault: BigUint64Array): number | Promise<number>;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/** The UTF-8 strings and stored counts of an immutable keyword table. @internal */
|
|
624
|
+
interface NativeFrozenStrings {
|
|
625
|
+
/** The concatenated UTF-8 text. */
|
|
626
|
+
text: Uint8Array;
|
|
627
|
+
/** The text boundaries, with two strings per surface entry and one per other entry. */
|
|
628
|
+
offsets: Uint32Array;
|
|
629
|
+
/** The stored count of each entry. */
|
|
630
|
+
counts: Uint32Array;
|
|
631
|
+
}
|
|
632
|
+
/** The optional reverse posting index for removing a frozen document. @internal */
|
|
633
|
+
interface NativeFrozenRemovalIndex {
|
|
634
|
+
/** Each document's first row reference, followed by the terminal reference count. */
|
|
635
|
+
starts: Uint32Array;
|
|
636
|
+
/** The posting row references, in ascending order within each document. */
|
|
637
|
+
rows: Uint32Array;
|
|
638
|
+
/** The sorted term ordinal for each payload slot. */
|
|
639
|
+
termOfSlot: Uint32Array;
|
|
640
|
+
}
|
|
641
|
+
/** The immutable keyword regions of a frozen segment. @internal */
|
|
642
|
+
interface NativeFrozenSegment {
|
|
643
|
+
/** The terms in code point order, with their stored document frequencies. */
|
|
644
|
+
terms: NativeFrozenStrings;
|
|
645
|
+
/** The posting slot for each sorted term ordinal. */
|
|
646
|
+
payloadSlots: Uint32Array;
|
|
647
|
+
/** Each payload slot's first posting, followed by the terminal posting count. */
|
|
648
|
+
postingOffsets: Uint32Array;
|
|
649
|
+
/** The document ordinal of each posting. */
|
|
650
|
+
postingDocuments: Uint32Array;
|
|
651
|
+
/** The capped term frequency of each posting. */
|
|
652
|
+
postingFrequencies: Uint16Array;
|
|
653
|
+
/** The field ordinal of each posting. */
|
|
654
|
+
postingFields: Uint16Array;
|
|
655
|
+
/** The surface and token pairs, or null when surfaces are absent. */
|
|
656
|
+
surfaces: NativeFrozenStrings | null;
|
|
657
|
+
/** The spellings in spelling and token order, or null when partial words are absent. */
|
|
658
|
+
spellings: NativeFrozenStrings | null;
|
|
659
|
+
/** The sorted term ordinal of each spelling, or an empty region when spellings are absent. */
|
|
660
|
+
spellingTokens: Uint32Array;
|
|
661
|
+
/** The reverse posting index, or null to scan the posting lists. */
|
|
662
|
+
removalIndex: NativeFrozenRemovalIndex | null;
|
|
663
|
+
/** One for each partial-word field and zero for every other field. */
|
|
664
|
+
partialFields: Uint8Array;
|
|
665
|
+
/** The number of document ordinals in this segment. */
|
|
666
|
+
documentCount: number;
|
|
667
|
+
}
|
|
668
|
+
/** The removal regions that one copy holds separately from a shared frozen segment. @internal */
|
|
669
|
+
interface NativeFrozenSegmentState {
|
|
670
|
+
/** The removed document ordinals in the uint32 bitset layout. */
|
|
671
|
+
tombstones: Uint32Array;
|
|
672
|
+
/** The single-word count of removed documents. */
|
|
673
|
+
tombstoneCount: Uint32Array;
|
|
674
|
+
/** The removed document count for each sorted term. */
|
|
675
|
+
removedDocuments: Uint32Array;
|
|
676
|
+
/** The removed capped term frequencies for each sorted term. */
|
|
677
|
+
removedOccurrences: Float64Array;
|
|
678
|
+
/** The removed occurrences of each surface entry. */
|
|
679
|
+
removedSurfaces: Uint32Array;
|
|
680
|
+
/** The removed occurrences of each spelling entry. */
|
|
681
|
+
removedSpellings: Uint32Array;
|
|
682
|
+
/** Eight words, holding the pending document count, the pending token count, and the pending unit count. */
|
|
683
|
+
pendingHeader: Uint32Array;
|
|
684
|
+
/** The tombstoned ordinals whose counts the removed regions do not hold yet, in removal order. */
|
|
685
|
+
pendingDocuments: Uint32Array;
|
|
686
|
+
/** Five words for each pending token: its field, term offset, term length, surface offset, and surface length. */
|
|
687
|
+
pendingTokens: Uint32Array;
|
|
688
|
+
/** The UTF-16 code units that the pending tokens point into. */
|
|
689
|
+
pendingUnits: Uint16Array;
|
|
690
|
+
}
|
|
691
|
+
/** The paged sections that hold the removal entries of a segment whose postings remain on disk. @internal */
|
|
692
|
+
interface NativeFrozenPagedRemovals {
|
|
693
|
+
/** The section that holds the first word of each document's removal entry. */
|
|
694
|
+
offsets: NativePageSection;
|
|
695
|
+
/** The section that holds each removal entry's sorted term and frequency pairs. */
|
|
696
|
+
values: NativePageSection;
|
|
697
|
+
/** The page cache of the calling thread, or null to read every page from the file. */
|
|
698
|
+
cache: NativePageCache | null;
|
|
699
|
+
/** Receives the file identity, section offset, and page number of a page that the core cannot read. */
|
|
700
|
+
fault: BigUint64Array;
|
|
701
|
+
}
|
|
122
702
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
703
|
+
* The regions of a {@link NativeFrozenSegment} and of its {@link NativeFrozenSegmentState}, as thirty positional
|
|
704
|
+
* arguments in the order that the native binding reads them, so that the binding looks up no property by name.
|
|
705
|
+
* An absent surface table, spelling table, or reverse posting index passes null in each of its positions.
|
|
706
|
+
* @internal
|
|
707
|
+
*/
|
|
708
|
+
type NativeFrozenRegionArguments = [
|
|
709
|
+
documentCount: number,
|
|
710
|
+
termText: Uint8Array,
|
|
711
|
+
termOffsets: Uint32Array,
|
|
712
|
+
termCounts: Uint32Array,
|
|
713
|
+
surfaceText: Uint8Array | null,
|
|
714
|
+
surfaceOffsets: Uint32Array | null,
|
|
715
|
+
surfaceCounts: Uint32Array | null,
|
|
716
|
+
spellingText: Uint8Array | null,
|
|
717
|
+
spellingOffsets: Uint32Array | null,
|
|
718
|
+
spellingCounts: Uint32Array | null,
|
|
719
|
+
payloadSlots: Uint32Array,
|
|
720
|
+
postingOffsets: Uint32Array,
|
|
721
|
+
postingDocuments: Uint32Array,
|
|
722
|
+
postingFrequencies: Uint16Array,
|
|
723
|
+
postingFields: Uint16Array,
|
|
724
|
+
partialFields: Uint8Array,
|
|
725
|
+
spellingTokens: Uint32Array,
|
|
726
|
+
removalStarts: Uint32Array | null,
|
|
727
|
+
removalRows: Uint32Array | null,
|
|
728
|
+
removalTermOfSlot: Uint32Array | null,
|
|
729
|
+
tombstones: Uint32Array,
|
|
730
|
+
tombstoneCount: Uint32Array,
|
|
731
|
+
removedDocuments: Uint32Array,
|
|
732
|
+
removedOccurrences: Float64Array,
|
|
733
|
+
removedSurfaces: Uint32Array,
|
|
734
|
+
removedSpellings: Uint32Array,
|
|
735
|
+
pendingHeader: Uint32Array,
|
|
736
|
+
pendingDocuments: Uint32Array,
|
|
737
|
+
pendingTokens: Uint32Array,
|
|
738
|
+
pendingUnits: Uint16Array
|
|
739
|
+
];
|
|
740
|
+
/** The operations that remove documents from immutable keyword segments. @internal */
|
|
741
|
+
interface NativeFrozenSegmentCore {
|
|
742
|
+
/**
|
|
743
|
+
* Prepares a frozen removal for publication after the host finishes the document's other changes.
|
|
744
|
+
* @param parameters - The segment's and the state's regions as {@link NativeFrozenRegionArguments}, then the
|
|
745
|
+
* document ordinal below the segment's document count, then the document's analysed tokens whose surface differs
|
|
746
|
+
* from their term or whose field is a partial field, grouped by ascending field ordinal. Then come the entries that
|
|
747
|
+
* receive a region kind and an element index for each changed value, where the kinds are 4 for tombstone words,
|
|
748
|
+
* 5 for the tombstone count, and 6 for pending header words, then the replacement values in the same order, and
|
|
749
|
+
* last the paged removal sections, or null for a segment that holds its postings in memory. The call writes the
|
|
750
|
+
* pending document and tokens past the pending counts, and it settles the pending regions first when they are full.
|
|
751
|
+
* @returns The number of changes, or a negative core status that leaves every region unchanged.
|
|
752
|
+
* The host must keep the publication write gate until it copies every prepared value into its region.
|
|
753
|
+
*/
|
|
754
|
+
prepareFrozenRemoval(...parameters: [
|
|
755
|
+
...NativeFrozenRegionArguments,
|
|
756
|
+
ordinal: number,
|
|
757
|
+
fields: readonly NativeFieldTokens[],
|
|
758
|
+
entries: Uint32Array,
|
|
759
|
+
values: Float64Array,
|
|
760
|
+
paged: NativeFrozenPagedRemovals | null
|
|
761
|
+
]): number;
|
|
762
|
+
/**
|
|
763
|
+
* Records one document's removal in the pending regions while preserving the shared segment regions.
|
|
764
|
+
* @param parameters - The segment's and the state's regions as {@link NativeFrozenRegionArguments}, then the
|
|
765
|
+
* document ordinal below the segment's document count, then the document's analysed tokens whose surface differs
|
|
766
|
+
* from their term or whose field is a partial field, grouped by ascending field ordinal, and last the paged removal
|
|
767
|
+
* sections, or null for a segment that holds its postings in memory. The core appends every token that it
|
|
768
|
+
* receives to the pending regions.
|
|
769
|
+
* @returns Zero on success, including an ordinal already removed, or a positive core status on refusal.
|
|
770
|
+
* Every refusal leaves the source and removal regions unchanged.
|
|
771
|
+
*/
|
|
772
|
+
removeFrozenDocument(...parameters: [
|
|
773
|
+
...NativeFrozenRegionArguments,
|
|
774
|
+
ordinal: number,
|
|
775
|
+
fields: readonly NativeFieldTokens[],
|
|
776
|
+
paged: NativeFrozenPagedRemovals | null
|
|
777
|
+
]): number;
|
|
778
|
+
/**
|
|
779
|
+
* Adds every pending removal to the removed regions and empties the pending regions.
|
|
780
|
+
* @param parameters - The segment's and the state's regions as {@link NativeFrozenRegionArguments}, then the paged
|
|
781
|
+
* removal sections, or null for a segment that holds its postings in memory.
|
|
782
|
+
* @returns Zero on success, or a positive core status that leaves every region unchanged.
|
|
783
|
+
*/
|
|
784
|
+
settleFrozenState(...parameters: [...NativeFrozenRegionArguments, paged: NativeFrozenPagedRemovals | null]): number;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/** The frozen spelling index that narrows substring candidates. @internal */
|
|
788
|
+
interface NativeFrozenRuns {
|
|
789
|
+
/** Three Unicode code points per run, in ascending order. */
|
|
790
|
+
runs: Uint32Array;
|
|
791
|
+
/** The member offsets, including the terminal offset. */
|
|
792
|
+
offsets: Uint32Array;
|
|
793
|
+
/** The spelling ordinals of each run. */
|
|
794
|
+
members: Uint32Array;
|
|
795
|
+
}
|
|
796
|
+
/** The keyword and spelling regions of one partial-word source. @internal */
|
|
797
|
+
interface NativePartialSource {
|
|
798
|
+
/** The keyword regions and their current removal counts. */
|
|
799
|
+
segment: NativeExpansionSegment;
|
|
800
|
+
/** The frozen run index, or null for a growing source or an absent spelling table. */
|
|
801
|
+
runs: NativeFrozenRuns | null;
|
|
802
|
+
}
|
|
803
|
+
/** The analysed words and typo settings of one partial-word request. @internal */
|
|
804
|
+
interface NativePartialRequest {
|
|
805
|
+
/** The unstemmed word in UTF-16. */
|
|
806
|
+
written: Uint16Array;
|
|
807
|
+
/** The indexed query token in UTF-16. */
|
|
808
|
+
own: Uint16Array;
|
|
809
|
+
/** The edit distance whose matches must be excluded. */
|
|
810
|
+
tolerance: number;
|
|
811
|
+
/** The leading code points that a typo match must share. */
|
|
812
|
+
prefixLength: number;
|
|
813
|
+
}
|
|
814
|
+
/** The native operation that selects partial-word additions. @internal */
|
|
815
|
+
interface NativePartialExpansionCore {
|
|
816
|
+
/**
|
|
817
|
+
* Returns additions by partition document frequency and then code point order.
|
|
818
|
+
* Divides 50 additions among the first 50 requests whose written words have at least three code points.
|
|
819
|
+
* @param sources - Every keyword segment of the partition and its spelling index.
|
|
820
|
+
* @param requests - The analysed words in query order, including their typo exclusions.
|
|
821
|
+
* @param outStarts - Receives one offset per request and the terminal offset.
|
|
822
|
+
* @param outSegments - Receives the source segment index of each addition.
|
|
823
|
+
* @param outTokens - Receives the term ordinal in that source segment.
|
|
824
|
+
* @param outFactors - Receives each addition's binary64 factor.
|
|
825
|
+
* @returns The addition count, or a negative status that leaves every output unchanged.
|
|
826
|
+
*/
|
|
827
|
+
expandPartialWords(sources: readonly NativePartialSource[], requests: readonly NativePartialRequest[], outStarts: Uint32Array, outSegments: Uint32Array, outTokens: Uint32Array, outFactors: Float64Array): number;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
/** The keyword regions and removal state of one query expansion source. @internal */
|
|
831
|
+
interface NativeExpansionSegment {
|
|
832
|
+
/** The mutable keyword regions, or null for a frozen source. */
|
|
833
|
+
growing: NativeGrowingSegment | null;
|
|
834
|
+
/** The immutable keyword regions, or null for a growing source. */
|
|
835
|
+
frozen: NativeFrozenSegment | null;
|
|
836
|
+
/** The frozen source's removal counts, or null for a growing source. */
|
|
837
|
+
state: NativeFrozenSegmentState | null;
|
|
838
|
+
/** The frozen term totals by payload slot, when the source keeps its postings on disk. */
|
|
839
|
+
occurrences?: Float64Array | null;
|
|
840
|
+
}
|
|
841
|
+
/** The native operations that expand analysed query words. @internal */
|
|
842
|
+
interface NativeExpansionCore extends NativePartialExpansionCore {
|
|
843
|
+
/**
|
|
844
|
+
* Returns term suggestions by document frequency and then code point order.
|
|
845
|
+
* @param segments - Every keyword segment of the partition and its current removal counts.
|
|
846
|
+
* @param typed - The unstemmed prefix in UTF-16.
|
|
847
|
+
* @param stemmed - The stemmed prefix, used in segments without surface forms.
|
|
848
|
+
* @param limit - The maximum number of suggestions.
|
|
849
|
+
* @param outTerms - Receives triples of source index, term ordinal, and document frequency.
|
|
850
|
+
* @param outStarts - Receives one spelling offset per suggestion and the terminal offset.
|
|
851
|
+
* @param outSpellings - Receives triples of source index, kind, and ordinal. Kind 0 identifies a token and kind 1 a surface form.
|
|
852
|
+
* @param outOccurrences - Receives each spelling's summed occurrence count, in spelling order.
|
|
853
|
+
* @returns The suggestion count, or a negative status that leaves every output unchanged.
|
|
854
|
+
*/
|
|
855
|
+
suggestTerms(segments: readonly NativeExpansionSegment[], typed: Uint16Array, stemmed: Uint16Array, limit: number, outTerms: Uint32Array, outStarts: Uint32Array, outSpellings: Uint32Array, outOccurrences: Float64Array): number;
|
|
856
|
+
/**
|
|
857
|
+
* Returns up to 50 completions by partition document frequency and then code point order.
|
|
858
|
+
* @param segments - Every keyword segment of the partition and its current removal counts.
|
|
859
|
+
* @param typed - The unstemmed last query word in UTF-16.
|
|
860
|
+
* @param stemmed - The stemmed last query word, used when the partition has no surface forms.
|
|
861
|
+
* @param own - The query token whose code point length determines each completion's factor.
|
|
862
|
+
* @param outSegments - Receives the source segment index of each completion.
|
|
863
|
+
* @param outTokens - Receives the term ordinal in that source segment.
|
|
864
|
+
* @param outFactors - Receives each completion's binary64 factor.
|
|
865
|
+
* @returns The completion count, or a negative status that leaves every output unchanged.
|
|
866
|
+
*/
|
|
867
|
+
expandPrefix(segments: readonly NativeExpansionSegment[], typed: Uint16Array, stemmed: Uint16Array, own: Uint16Array, outSegments: Uint32Array, outTokens: Uint32Array, outFactors: Float64Array): number;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* The typed regions of reduced sort values, indexed by ordinal or dictionary position.
|
|
126
872
|
*
|
|
127
|
-
*
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
873
|
+
* @internal
|
|
874
|
+
*/
|
|
875
|
+
interface NativeSortValues {
|
|
876
|
+
/** Marks missing, number, string, false, and true values with tags 0 through 4. */
|
|
877
|
+
kinds: Uint8Array;
|
|
878
|
+
/** Holds the finite number at each position whose tag is 1. */
|
|
879
|
+
numbers: Float64Array;
|
|
880
|
+
/** Holds the first UTF-16 unit of each string in units. */
|
|
881
|
+
textStart: Uint32Array;
|
|
882
|
+
/** Holds each string's UTF-16 length, covering at most 512 code points. */
|
|
883
|
+
textLength: Uint32Array;
|
|
884
|
+
/** Holds the UTF-16 units of the strings. */
|
|
885
|
+
units: Uint16Array;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* The current values and the last built order of one sort column.
|
|
131
889
|
*
|
|
132
|
-
* @
|
|
133
|
-
|
|
134
|
-
|
|
890
|
+
* @internal
|
|
891
|
+
*/
|
|
892
|
+
interface NativeSortColumn {
|
|
893
|
+
/** Holds each ordinal's current reduced value. */
|
|
894
|
+
current: NativeSortValues;
|
|
895
|
+
/** Holds the distinct present values of the built order. */
|
|
896
|
+
values: NativeSortValues;
|
|
897
|
+
/** Holds each built ordinal's even dictionary rank, or -1 for missing. */
|
|
898
|
+
ranks: Int32Array;
|
|
899
|
+
/** Holds the built present ordinals in ascending rank order. */
|
|
900
|
+
ordered: Uint32Array;
|
|
901
|
+
/** Marks the ordinals whose current values differ from the built order. */
|
|
902
|
+
dirty: Uint32Array;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Reductions of stored fields for sorting.
|
|
135
906
|
*
|
|
136
|
-
* @
|
|
907
|
+
* @internal
|
|
137
908
|
*/
|
|
138
|
-
|
|
909
|
+
interface NativeSortCore {
|
|
910
|
+
/**
|
|
911
|
+
* Selects ordinals by each field's rank and current value, retaining every cutoff tie.
|
|
912
|
+
*
|
|
913
|
+
* @param columns - The sort columns in field priority order.
|
|
914
|
+
* @param directions - One direction per column, with 0 for ascending and 1 for descending.
|
|
915
|
+
* @param filter - The bitmap of ordinals that pass the filter.
|
|
916
|
+
* @param live - The bitmap of live document ordinals.
|
|
917
|
+
* @param limit - The requested ordinal count before retaining equal sort keys.
|
|
918
|
+
* @param anchorRanks - One rank per anchor field, or null for no anchor.
|
|
919
|
+
* @param anchorValues - One reduced value per anchor field, or null with no anchor ranks.
|
|
920
|
+
* @param output - Receives the selected ordinals, including keys equal to the anchor.
|
|
921
|
+
* @returns The selected count, or a negative status with the output unchanged. The caller orders equal keys by document ID and removes IDs at or before an equal anchor.
|
|
922
|
+
*/
|
|
923
|
+
sortSelect(columns: readonly NativeSortColumn[], directions: Uint8Array, filter: Uint32Array, live: Uint32Array, limit: number, anchorRanks: Int32Array | null, anchorValues: NativeSortValues | null, output: Uint32Array): number;
|
|
924
|
+
/**
|
|
925
|
+
* Selects live values within text bounds in folded and raw sort order.
|
|
926
|
+
*
|
|
927
|
+
* @param column - The current values and built order of the field.
|
|
928
|
+
* @param lower - The lower UTF-16 bound, or null for no lower bound.
|
|
929
|
+
* @param lowerInclusive - Whether a value equal to the lower bound qualifies.
|
|
930
|
+
* @param upper - The upper UTF-16 bound, or null for no upper bound.
|
|
931
|
+
* @param upperInclusive - Whether a value equal to the upper bound qualifies.
|
|
932
|
+
* @param live - The bitmap of live ordinals in the current values.
|
|
933
|
+
* @param output - Receives the matching ordinals, with padding bits cleared.
|
|
934
|
+
* @returns 0 on success, or a negative status with the output unchanged.
|
|
935
|
+
*/
|
|
936
|
+
textRange(column: NativeSortColumn, lower: Uint16Array | null, lowerInclusive: boolean, upper: Uint16Array | null, upperInclusive: boolean, live: Uint32Array, output: Uint32Array): number;
|
|
937
|
+
/**
|
|
938
|
+
* Builds an ascending dictionary and ranks for the live sort values.
|
|
939
|
+
*
|
|
940
|
+
* @param current - The current values, indexed by document ordinal.
|
|
941
|
+
* @param live - The bitmap of live document ordinals.
|
|
942
|
+
* @param values - Receives the distinct present values in ascending order.
|
|
943
|
+
* @param ranks - Receives each ordinal's even dictionary rank, or -1 for missing and dead ordinals.
|
|
944
|
+
* @param ordered - Receives the live present ordinals in rank order, with equal values in ordinal order.
|
|
945
|
+
* @param dirty - Receives cleared words through the current ordinal capacity.
|
|
946
|
+
* @param counts - Receives the distinct-value count and present-ordinal count in its first two entries.
|
|
947
|
+
* @returns 0 on success, or a negative status with every output region unchanged.
|
|
948
|
+
*/
|
|
949
|
+
buildSortOrder(current: NativeSortValues, live: Uint32Array, values: NativeSortValues, ranks: Int32Array, ordered: Uint32Array, dirty: Uint32Array, counts: Uint32Array): number;
|
|
950
|
+
/**
|
|
951
|
+
* Reduces a stored field to its sort value under the requested array mode.
|
|
952
|
+
*
|
|
953
|
+
* @param values - The eight typed regions of the stored field.
|
|
954
|
+
* @param ordinal - The document's position in the field regions.
|
|
955
|
+
* @param mode - 0 for min, 1 for max, 2 for avg, or 3 for median. Scalar fields bypass array reduction.
|
|
956
|
+
* @param outNumber - Receives a numeric result in its first entry, with capacity for at least one entry.
|
|
957
|
+
* @param outText - Receives a string's start and UTF-16 length in values.units, with capacity for at least two entries.
|
|
958
|
+
* @returns 0 for missing, 1 for number, 2 for string, 3 for false, or 4 for true. A negative status leaves both output regions unchanged. Missing and boolean results also leave both regions unchanged.
|
|
959
|
+
*/
|
|
960
|
+
sortValue(values: NativeStoredValues, ordinal: number, mode: number, outNumber: Float64Array, outText: Uint32Array): number;
|
|
961
|
+
}
|
|
139
962
|
|
|
140
963
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
964
|
+
* Creates a search engine that runs inside your process, with no server to
|
|
965
|
+
* provision.
|
|
143
966
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
967
|
+
* The engine holds every index you create, so an application usually keeps one
|
|
968
|
+
* instance for its lifetime. When you configure persistence, this recovers the
|
|
969
|
+
* indexes already on disk before it resolves. Lifecycle settings register
|
|
970
|
+
* those indexes as closed and load each one when its first request arrives.
|
|
147
971
|
*
|
|
148
|
-
* @param
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
151
|
-
* other object.
|
|
972
|
+
* @param config - This carries the persistence, partitioning, and worker
|
|
973
|
+
* invalidation settings. Omit it for an engine that keeps everything in memory.
|
|
974
|
+
* @returns The engine, ready for {@link Narsil.createIndex} to run against.
|
|
152
975
|
*
|
|
153
976
|
* @public
|
|
154
977
|
*/
|
|
155
|
-
declare function
|
|
978
|
+
declare function createNarsil(config?: NarsilConfig): Promise<Narsil>;
|
|
156
979
|
|
|
157
980
|
/**
|
|
158
981
|
* Sets how many normalised tokens the engine keeps cached.
|
|
@@ -198,29 +1021,177 @@ declare function resetNormalizationCache(): void;
|
|
|
198
1021
|
declare function getNormalizationCacheSize(): number;
|
|
199
1022
|
|
|
200
1023
|
/**
|
|
201
|
-
*
|
|
1024
|
+
* A typed region of a field index, stored values, or a pattern index.
|
|
202
1025
|
*
|
|
203
|
-
*
|
|
204
|
-
|
|
205
|
-
|
|
1026
|
+
* @internal
|
|
1027
|
+
*/
|
|
1028
|
+
type NativeFieldMergeRegion = Uint8Array | Uint16Array | Uint32Array | Float64Array | BigUint64Array;
|
|
1029
|
+
/**
|
|
1030
|
+
* One source field and its document mapping.
|
|
206
1031
|
*
|
|
207
|
-
* @
|
|
208
|
-
|
|
1032
|
+
* @internal
|
|
1033
|
+
*/
|
|
1034
|
+
interface NativeFieldMergeSource {
|
|
1035
|
+
/** Each source ordinal's target, or 0xFFFFFFFF for a dropped document. */
|
|
1036
|
+
mapping: Uint32Array;
|
|
1037
|
+
/** The field's regions in the order that the merge kind defines. */
|
|
1038
|
+
regions: readonly NativeFieldMergeRegion[];
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* The operations that combine field regions across segments.
|
|
209
1042
|
*
|
|
210
|
-
* @
|
|
1043
|
+
* @internal
|
|
211
1044
|
*/
|
|
212
|
-
|
|
1045
|
+
interface NativeFieldMergeCore {
|
|
1046
|
+
/**
|
|
1047
|
+
* Measures the regions of one merged field after document remapping.
|
|
1048
|
+
*
|
|
1049
|
+
* @param kind - 1 numeric, 2 boolean, 3 enum, 4 geo, 5 stored values, or 6 pattern.
|
|
1050
|
+
* @param sources - The source fields and disjoint mappings that cover the target ordinals. Numeric regions contain values and ordinals; boolean regions contain true and false bitmaps; enum regions contain units, text offsets, posting offsets, postings, and suffix order; geo regions contain codes, latitudes, longitudes, and ordinals; stored regions contain shapes, starts, kinds, numbers, text starts, text lengths, units, and bytes; pattern regions contain present ordinals, runs, offsets, and postings.
|
|
1051
|
+
* @param documentCount - The number of target documents.
|
|
1052
|
+
* @param sizes - Receives eight region lengths in elements, with unused entries set to zero.
|
|
1053
|
+
* @returns 0 on success, or an existing positive status that leaves all supplied regions unchanged.
|
|
1054
|
+
*/
|
|
1055
|
+
measureFieldMerge(kind: number, sources: readonly NativeFieldMergeSource[], documentCount: number, sizes: Uint32Array): number;
|
|
1056
|
+
/**
|
|
1057
|
+
* Writes the merged field into the measured target regions.
|
|
1058
|
+
*
|
|
1059
|
+
* @param kind - The field kind used by {@link NativeFieldMergeCore.measureFieldMerge}.
|
|
1060
|
+
* @param sources - The source regions and document mappings used for measurement.
|
|
1061
|
+
* @param documentCount - The number of target documents.
|
|
1062
|
+
* @param output - The target regions in source-region order, each with the measured capacity and no overlap with another target or an input.
|
|
1063
|
+
* @returns 0 on success, 3 when a target is too short, or another existing positive status; every refusal leaves all supplied regions unchanged.
|
|
1064
|
+
*/
|
|
1065
|
+
writeFieldMerge(kind: number, sources: readonly NativeFieldMergeSource[], documentCount: number, output: readonly NativeFieldMergeRegion[]): number;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
213
1068
|
/**
|
|
214
|
-
*
|
|
1069
|
+
* This makes pattern search available to every index whose schema declares a
|
|
1070
|
+
* pattern field, meaning a `verbatim` field or a text field whose type
|
|
1071
|
+
* includes `pattern`.
|
|
215
1072
|
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
1073
|
+
* A Node process needs no such call, because it loads the pattern search code
|
|
1074
|
+
* by itself. A browser app has to import `patternSearch` from
|
|
1075
|
+
* `@delali/narsil/pattern` and pass it to this function before it creates or
|
|
1076
|
+
* loads an index with a pattern field.
|
|
1077
|
+
*
|
|
1078
|
+
* @param module - The `patternSearch` object that `@delali/narsil/pattern`
|
|
1079
|
+
* exports.
|
|
1080
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` for any other object.
|
|
220
1081
|
*
|
|
221
1082
|
* @public
|
|
222
1083
|
*/
|
|
223
|
-
declare function
|
|
1084
|
+
declare function registerPatternSearch(module: PatternSearch): void;
|
|
1085
|
+
|
|
1086
|
+
/** The keyword regions and selected ordinals of one merge source. @internal */
|
|
1087
|
+
interface NativeKeywordMergeInput {
|
|
1088
|
+
/** The growing keyword regions, when the source uses mutable slices. Frozen posting columns are ignored. */
|
|
1089
|
+
growing?: NativeGrowingSegment | null;
|
|
1090
|
+
/** The UTF-8 terms and their stored document counts. */
|
|
1091
|
+
terms: NativeFrozenStrings;
|
|
1092
|
+
/** The posting slot of each term. */
|
|
1093
|
+
payloadSlots: Uint32Array;
|
|
1094
|
+
/** The first posting of each slot, followed by the terminal posting count. */
|
|
1095
|
+
postingOffsets: Uint32Array;
|
|
1096
|
+
/** The source document ordinal of each posting. */
|
|
1097
|
+
postingDocuments: Uint32Array;
|
|
1098
|
+
/** The capped frequency of each posting. */
|
|
1099
|
+
postingFrequencies: Uint16Array;
|
|
1100
|
+
/** The source field ordinal of each posting. */
|
|
1101
|
+
postingFields: Uint16Array;
|
|
1102
|
+
/** The first position of each posting and the terminal count, or null without positions. */
|
|
1103
|
+
positionOffsets: Uint32Array | null;
|
|
1104
|
+
/** The position values, or null without positions. */
|
|
1105
|
+
positionValues: Uint32Array | null;
|
|
1106
|
+
/** The target ordinal of each source document, or UINT32_MAX for a dropped document. */
|
|
1107
|
+
mapping: Uint32Array;
|
|
1108
|
+
/** The target field ordinal of each source field. */
|
|
1109
|
+
fieldMapping: Uint16Array;
|
|
1110
|
+
/** The source field length columns, with null for a field without lengths. */
|
|
1111
|
+
fieldLengths: readonly (Uint32Array | null)[];
|
|
1112
|
+
/** The number of source document ordinals. */
|
|
1113
|
+
documentCount: number;
|
|
1114
|
+
/** The surface and token pairs, with counts already restricted to the selected documents. */
|
|
1115
|
+
surfaces: NativeFrozenStrings | null;
|
|
1116
|
+
/** The spelling and token pairs, with counts already restricted to the selected documents. */
|
|
1117
|
+
spellings: NativeFrozenStrings | null;
|
|
1118
|
+
}
|
|
1119
|
+
/** The caller-owned columns that receive one merged keyword segment. @internal */
|
|
1120
|
+
interface NativeKeywordMergeOutput {
|
|
1121
|
+
/** The terms in code point order, with their live document counts. */
|
|
1122
|
+
terms: NativeFrozenStrings;
|
|
1123
|
+
/** The first posting of each term and the terminal posting count. */
|
|
1124
|
+
postingOffsets: Uint32Array;
|
|
1125
|
+
/** The target document ordinal of each posting, ascending within each term. */
|
|
1126
|
+
postingDocuments: Uint32Array;
|
|
1127
|
+
/** The unchanged capped posting frequencies. */
|
|
1128
|
+
postingFrequencies: Uint16Array;
|
|
1129
|
+
/** The target field ordinals, preserving the source order within each document. */
|
|
1130
|
+
postingFields: Uint16Array;
|
|
1131
|
+
/** The position boundaries, or null when every source omits positions. */
|
|
1132
|
+
positionOffsets: Uint32Array | null;
|
|
1133
|
+
/** The unchanged posting positions, or null when every source omits positions. */
|
|
1134
|
+
positionValues: Uint32Array | null;
|
|
1135
|
+
/** The merged field length columns in field-major order. */
|
|
1136
|
+
fieldLengths: Uint32Array;
|
|
1137
|
+
/** The length total of each target field. */
|
|
1138
|
+
totalFieldLengths: Float64Array;
|
|
1139
|
+
/** The merged surface and token pairs in surface order. */
|
|
1140
|
+
surfaces: NativeFrozenStrings;
|
|
1141
|
+
/** The merged spelling and token pairs in spelling and token order. */
|
|
1142
|
+
spellings: NativeFrozenStrings;
|
|
1143
|
+
}
|
|
1144
|
+
/** The columns that receive a merged paged posting list. @internal */
|
|
1145
|
+
interface NativePostingMergeOutput {
|
|
1146
|
+
/** The target document ordinals in ascending order. */
|
|
1147
|
+
documents: Uint32Array;
|
|
1148
|
+
/** The unchanged frequencies, with the same capacity as documents. */
|
|
1149
|
+
frequencies: Uint16Array;
|
|
1150
|
+
/** The mapped fields in ascending order within each document, with the same capacity as documents. */
|
|
1151
|
+
fields: Uint16Array;
|
|
1152
|
+
/** The first position of each output row, followed by the terminal position count. */
|
|
1153
|
+
positionOffsets: Uint32Array;
|
|
1154
|
+
/** The unchanged positions of the retained rows. */
|
|
1155
|
+
positions: Uint32Array;
|
|
1156
|
+
/** Receives the distinct document count and the total frequency in its first two entries. */
|
|
1157
|
+
totals: Float64Array;
|
|
1158
|
+
}
|
|
1159
|
+
/** The operations that measure and write immutable keyword merges. @internal */
|
|
1160
|
+
interface NativeSegmentMergeCore {
|
|
1161
|
+
/**
|
|
1162
|
+
* Remaps and orders the selected posting rows by target document and field for paged storage.
|
|
1163
|
+
* @param inputs - Frozen source rows for one term, with document and field mappings.
|
|
1164
|
+
* @param documentCount - The target document count.
|
|
1165
|
+
* @param fieldCount - The target field count, at most 65,536.
|
|
1166
|
+
* @param output - The writable columns. Position offsets need one more entry than the retained row count.
|
|
1167
|
+
* @returns The retained row count, or a negative status that leaves every output unchanged.
|
|
1168
|
+
*/
|
|
1169
|
+
mergePostings(inputs: readonly NativeKeywordMergeInput[], documentCount: number, fieldCount: number, output: NativePostingMergeOutput): number;
|
|
1170
|
+
/**
|
|
1171
|
+
* Measures the regions needed by a keyword merge without changing its sources.
|
|
1172
|
+
* @param inputs - The source columns, document mappings, and prepared surface and spelling counts.
|
|
1173
|
+
* @param documentCount - The target document count. Kept mappings must cover each target ordinal exactly once.
|
|
1174
|
+
* @param fieldCount - The target field count, at most 65,536.
|
|
1175
|
+
* @param sizes - Receives nine uint32 values: term count, term bytes, posting count, position count,
|
|
1176
|
+
* position presence, surface count, surface bytes, spelling count, and spelling bytes.
|
|
1177
|
+
* @param retainedTerms - The completed paged term table, when merging metadata after streaming postings.
|
|
1178
|
+
* Sources must then have empty term and posting regions. The output includes this table and no postings.
|
|
1179
|
+
* @returns Zero on success, eight when a surface or spelling count requires split outputs,
|
|
1180
|
+
* or another positive core status. Every refusal leaves all regions unchanged.
|
|
1181
|
+
*/
|
|
1182
|
+
measureMerge(inputs: readonly NativeKeywordMergeInput[], documentCount: number, fieldCount: number, sizes: Uint32Array, retainedTerms?: NativeFrozenStrings | null): number;
|
|
1183
|
+
/**
|
|
1184
|
+
* Writes a merged keyword segment into the supplied regions.
|
|
1185
|
+
* @param inputs - The unchanged sources and mappings used for measurement.
|
|
1186
|
+
* @param documentCount - The target document count.
|
|
1187
|
+
* @param fieldCount - The target field count.
|
|
1188
|
+
* @param output - The writable regions, with capacities obtained from measureMerge.
|
|
1189
|
+
* @param retainedTerms - The completed paged term table supplied to measureMerge, or null for a full merge.
|
|
1190
|
+
* @returns Zero on success, three for a short region, eight when a count requires split outputs,
|
|
1191
|
+
* or another positive core status. Every refusal leaves all regions unchanged.
|
|
1192
|
+
*/
|
|
1193
|
+
writeMerge(inputs: readonly NativeKeywordMergeInput[], documentCount: number, fieldCount: number, output: NativeKeywordMergeOutput, retainedTerms?: NativeFrozenStrings | null): number;
|
|
1194
|
+
}
|
|
224
1195
|
|
|
225
1196
|
/**
|
|
226
1197
|
* A set of stop words that the native search core holds, which an analysis call takes in place of the
|
|
@@ -274,13 +1245,30 @@ interface NativeAnalysisCore {
|
|
|
274
1245
|
* @param flags - The analysis steps to take, as bits from the core's header.
|
|
275
1246
|
* @param text - The text.
|
|
276
1247
|
* @param stopWords - The stop words to remove, or `null` for the module's own list.
|
|
277
|
-
* @param records - The array that receives the token count in its first entry and then
|
|
1248
|
+
* @param records - The array that receives the token count in its first entry and then eight entries for
|
|
278
1249
|
* each token: its position, the offset and length of its term, the offset and length of its surface form
|
|
279
|
-
* (an offset of 0xffffffff where it has none),
|
|
1250
|
+
* (an offset of 0xffffffff where it has none), the offset and length of its original spelling, and its cache slot.
|
|
280
1251
|
* @returns The text that every offset points into, `null` where `records` holds too few entries for every
|
|
281
1252
|
* token (its first entry then holds the token count), or a negative status code from the core's header.
|
|
282
1253
|
*/
|
|
283
1254
|
analyse(language: number, flags: number, text: string, stopWords: NativeStopWordSetHandle | null, records: Uint32Array): string | number | null;
|
|
1255
|
+
/**
|
|
1256
|
+
* Splits a text into tokens and packs them for a keyword write into the caller's buffers, so a caller can reuse
|
|
1257
|
+
* the same two buffers for every text.
|
|
1258
|
+
*
|
|
1259
|
+
* @param language - The index of the language module to analyse with.
|
|
1260
|
+
* @param flags - The analysis steps to take, as bits from the core's header.
|
|
1261
|
+
* @param text - The text.
|
|
1262
|
+
* @param stopWords - The stop words to remove, or `null` for the module's own list.
|
|
1263
|
+
* @param records - At least two entries, filled with the token count and then eight words for each token, laid
|
|
1264
|
+
* out as {@link NativeAnalysisCore.analyse} lays them out, with offsets into `units`, zero original-spelling
|
|
1265
|
+
* words, and a cache slot of 0xffffffff.
|
|
1266
|
+
* @param units - The array that receives the term and surface text of every token.
|
|
1267
|
+
* @returns The number of units written, `null` where either array holds too few entries (the first entry of
|
|
1268
|
+
* `records` then holds the token count and the second the number of units needed), or a negative status code
|
|
1269
|
+
* from the core's header.
|
|
1270
|
+
*/
|
|
1271
|
+
analysePacked(language: number, flags: number, text: string, stopWords: NativeStopWordSetHandle | null, records: Uint32Array, units: Uint16Array): number | null;
|
|
284
1272
|
/**
|
|
285
1273
|
* Normalises and stems one token without splitting it.
|
|
286
1274
|
*
|
|
@@ -332,6 +1320,156 @@ interface NativeKeywordCore {
|
|
|
332
1320
|
keywordScore(poolDocIds: Uint32Array, poolFrequencies: Uint16Array, poolFields: Uint16Array, rowDocIds: Uint32Array, rowFrequencies: Float64Array, rowFields: Uint16Array, slots: Uint32Array, lists: Uint32Array, listValues: Float64Array, slotValues: Float64Array, searchable: Uint8Array, partialMarks: Uint8Array, nameRanks: Uint16Array, fieldNumbers: Float64Array, lengths: ReadonlyArray<Uint32Array | null>, filter: Uint32Array | null, live: Uint32Array, removed: Uint32Array, settings: Float64Array, ordinals: Int32Array, scores: Float64Array, matched: Uint32Array, outcome: Float64Array): number;
|
|
333
1321
|
}
|
|
334
1322
|
|
|
1323
|
+
/**
|
|
1324
|
+
* The native operations that count field values and combine facet counts.
|
|
1325
|
+
*
|
|
1326
|
+
* @internal
|
|
1327
|
+
*/
|
|
1328
|
+
interface NativeFacetCore {
|
|
1329
|
+
/**
|
|
1330
|
+
* Counts matched documents once per range using stored numbers and direct numeric array elements.
|
|
1331
|
+
*
|
|
1332
|
+
* @param values - The field's stored values, indexed by document ordinal.
|
|
1333
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1334
|
+
* @param ranges - The inclusive lower and exclusive upper bounds in successive pairs.
|
|
1335
|
+
* @param outCounts - Receives one count per range, with zero for any NaN bound.
|
|
1336
|
+
* @returns 0 on success, or a negative status that leaves the output region unchanged.
|
|
1337
|
+
*/
|
|
1338
|
+
storedRangeFacet(values: NativeStoredValues, matched: Uint32Array, ranges: Float64Array, outCounts: Uint32Array): number;
|
|
1339
|
+
/**
|
|
1340
|
+
* Counts stored scalar values and array elements from matched documents.
|
|
1341
|
+
*
|
|
1342
|
+
* @param values - The field's stored values, indexed by document ordinal.
|
|
1343
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1344
|
+
* @param outValues - Receives the first matched element position for each distinct value.
|
|
1345
|
+
* @param outCounts - Receives each value's occurrence count, excluding null and encoded objects.
|
|
1346
|
+
* @returns The bucket count, or a negative status that leaves the output regions unchanged.
|
|
1347
|
+
*/
|
|
1348
|
+
valueFacet(values: NativeStoredValues, matched: Uint32Array, outValues: Uint32Array, outCounts: Uint32Array): number;
|
|
1349
|
+
/**
|
|
1350
|
+
* Counts matched documents for each enum value's posting list.
|
|
1351
|
+
*
|
|
1352
|
+
* @param offsets - The posting start of each value, followed by the terminal offset.
|
|
1353
|
+
* @param postings - The document ordinals in all posting lists.
|
|
1354
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1355
|
+
* @param outCounts - Receives one matched document count per value, including zero for an empty list.
|
|
1356
|
+
* @returns 0 on success, or a negative status that leaves the output region unchanged.
|
|
1357
|
+
*/
|
|
1358
|
+
enumFacet(offsets: Uint32Array, postings: Uint32Array, matched: Uint32Array, outCounts: Uint32Array): number;
|
|
1359
|
+
/**
|
|
1360
|
+
* Counts matched documents for each distinct numeric value in ascending order.
|
|
1361
|
+
*
|
|
1362
|
+
* @param values - The field entries in ascending numeric order.
|
|
1363
|
+
* @param ordinals - The document ordinal of each entry, with the same length as values.
|
|
1364
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1365
|
+
* @param outValues - Receives the distinct values, with signed zeros combined.
|
|
1366
|
+
* @param outCounts - Receives each value's matched document count.
|
|
1367
|
+
* @returns The bucket count, or a negative status that leaves the output regions unchanged.
|
|
1368
|
+
*/
|
|
1369
|
+
numberFacet(values: Float64Array, ordinals: Uint32Array, matched: Uint32Array, outValues: Float64Array, outCounts: Uint32Array): number;
|
|
1370
|
+
/**
|
|
1371
|
+
* Counts matched documents once in each numeric range that contains one of their values.
|
|
1372
|
+
*
|
|
1373
|
+
* @param values - The field entries in ascending numeric order.
|
|
1374
|
+
* @param ordinals - The document ordinal of each entry, with the same length as values.
|
|
1375
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1376
|
+
* @param ranges - The inclusive lower and exclusive upper bounds of each range in successive pairs.
|
|
1377
|
+
* @param outCounts - Receives one count per range, including zero for any range with a NaN bound.
|
|
1378
|
+
* @returns 0 on success, or a negative status that leaves the output region unchanged.
|
|
1379
|
+
*/
|
|
1380
|
+
rangeFacet(values: Float64Array, ordinals: Uint32Array, matched: Uint32Array, ranges: Float64Array, outCounts: Uint32Array): number;
|
|
1381
|
+
/**
|
|
1382
|
+
* Counts matched documents for each boolean value.
|
|
1383
|
+
*
|
|
1384
|
+
* @param trueBits - The ordinals that hold true, in at least one bitmap word.
|
|
1385
|
+
* @param falseBits - The ordinals that hold false, in at least one bitmap word.
|
|
1386
|
+
* @param matched - The matched ordinals, in at least one bitmap word.
|
|
1387
|
+
* @param counts - Receives the true count and false count in its first two entries.
|
|
1388
|
+
* @returns 0 on success, or a negative status with the output unchanged.
|
|
1389
|
+
*/
|
|
1390
|
+
booleanFacet(trueBits: Uint32Array, falseBits: Uint32Array, matched: Uint32Array, counts: Uint32Array): number;
|
|
1391
|
+
/**
|
|
1392
|
+
* Combines facet counts and returns the selected buckets with their error bound.
|
|
1393
|
+
*
|
|
1394
|
+
* @param offsets - Each source list's start in the flattened arrays, followed by the total entry count.
|
|
1395
|
+
* @param values - The value key of each bucket, which indexes valueRanks.
|
|
1396
|
+
* @param counts - The count of each bucket in source-list order.
|
|
1397
|
+
* @param bounds - Each source list's largest omitted count.
|
|
1398
|
+
* @param valueRanks - The code point order of the bucket keys, indexed by value key.
|
|
1399
|
+
* @param ascending - Whether counts order lowest first, with bucket keys deciding ties.
|
|
1400
|
+
* @param limit - The number of buckets to keep, or null to keep every bucket.
|
|
1401
|
+
* @param outValues - Receives the selected value keys.
|
|
1402
|
+
* @param outCounts - Receives each selected value's combined count.
|
|
1403
|
+
* @param outBound - Receives the error bound in its first word, including for an empty merge.
|
|
1404
|
+
* @returns The bucket count, or a negative core status that leaves inputs and output regions unchanged.
|
|
1405
|
+
*/
|
|
1406
|
+
mergeFacets(offsets: Uint32Array, values: Uint32Array, counts: Uint32Array, bounds: Uint32Array, valueRanks: Uint32Array, ascending: boolean, limit: number | null, outValues: Uint32Array, outCounts: Uint32Array, outBound: Uint32Array): number;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* A typed field region that a filter plan reads.
|
|
1411
|
+
*
|
|
1412
|
+
* @internal
|
|
1413
|
+
*/
|
|
1414
|
+
type NativeFilterRegion = Uint16Array | Uint32Array | Float64Array | BigUint64Array;
|
|
1415
|
+
/**
|
|
1416
|
+
* The native operation that evaluates field tests and boolean expressions.
|
|
1417
|
+
*
|
|
1418
|
+
* @internal
|
|
1419
|
+
*/
|
|
1420
|
+
interface NativeFilterCore {
|
|
1421
|
+
/**
|
|
1422
|
+
* Writes the live document ordinals that pass a postfix filter plan.
|
|
1423
|
+
*
|
|
1424
|
+
* @param plan - Groups of four words containing opcode, field, operator, and operand.
|
|
1425
|
+
* @param numbers - Numeric operands, with each numeric list preceded by its item count.
|
|
1426
|
+
* @param units - The UTF-16 code units of string operands.
|
|
1427
|
+
* @param offsets - Each string's start, followed by the terminal code-unit offset.
|
|
1428
|
+
* @param lists - Pairs containing the first string and item count of each string list.
|
|
1429
|
+
* @param bitsets - Operand bitmaps for pattern tests, text ranges, and complete sets.
|
|
1430
|
+
* @param kinds - Each field's kind: 0 absent, 1 numeric, 2 boolean, 3 enum, or 4 geo.
|
|
1431
|
+
* @param fields - Each field's present bitmap followed by its regions. Numeric fields take values and ordinals; boolean fields take true and false bitmaps; enum fields take units, offsets, posting offsets, postings, and suffix order; geo fields take codes, latitudes, longitudes, and ordinals.
|
|
1432
|
+
* @param live - The live ordinals, in at least one bitmap word.
|
|
1433
|
+
* @param into - Receives one word per live bitmap word, without overlapping an input region.
|
|
1434
|
+
* @returns 0 on success, or a negative status that leaves the output unchanged.
|
|
1435
|
+
*/
|
|
1436
|
+
evaluateFilter(plan: Uint32Array, numbers: Float64Array, units: Uint16Array, offsets: Uint32Array, lists: Uint32Array, bitsets: readonly Uint32Array[], kinds: Uint8Array, fields: readonly (readonly NativeFilterRegion[])[], live: Uint32Array, into: Uint32Array): number;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/** The analysed words that determine which text spans receive highlight tags. @internal */
|
|
1440
|
+
interface NativeHighlightQuery {
|
|
1441
|
+
/** The stemmed query words and the edit distance that each word permits. */
|
|
1442
|
+
terms: readonly {
|
|
1443
|
+
term: Uint16Array;
|
|
1444
|
+
tolerance: number;
|
|
1445
|
+
}[];
|
|
1446
|
+
/** The number of leading code points that a fuzzy match must preserve. */
|
|
1447
|
+
prefixLength: number;
|
|
1448
|
+
/** The unstemmed final query word, or null when prefix matching is disabled. */
|
|
1449
|
+
prefix: Uint16Array | null;
|
|
1450
|
+
/** The stemmed synonyms and phrase words that match exactly. */
|
|
1451
|
+
synonyms: readonly Uint16Array[];
|
|
1452
|
+
/** The words that may match inside longer written spellings. */
|
|
1453
|
+
partialWords: readonly Uint16Array[] | null;
|
|
1454
|
+
}
|
|
1455
|
+
/** The native operation that marks matching spans in the original text. @internal */
|
|
1456
|
+
interface NativeHighlightCore {
|
|
1457
|
+
/**
|
|
1458
|
+
* Returns highlighted text and its positions in the original UTF-16 text.
|
|
1459
|
+
* @param language - The built-in language index.
|
|
1460
|
+
* @param text - The original text in UTF-16.
|
|
1461
|
+
* @param query - The analysed words and their matching rules.
|
|
1462
|
+
* @param preTag - The UTF-16 text before each matching span.
|
|
1463
|
+
* @param postTag - The UTF-16 text after each matching span.
|
|
1464
|
+
* @param maxSnippetLength - The window length before tags and ellipses, or zero for the full text.
|
|
1465
|
+
* @param outSnippet - Receives the snippet's UTF-16 units.
|
|
1466
|
+
* @param outPositions - Receives pairs of start and end positions in the original text.
|
|
1467
|
+
* @param outLength - Receives the snippet's unit count in its first element.
|
|
1468
|
+
* @returns The position count, or a negative status that leaves every output unchanged.
|
|
1469
|
+
*/
|
|
1470
|
+
highlight(language: number, text: Uint16Array, query: NativeHighlightQuery, preTag: Uint16Array, postTag: Uint16Array, maxSnippetLength: number, outSnippet: Uint16Array, outPositions: Uint32Array, outLength: Uint32Array): number;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
335
1473
|
/**
|
|
336
1474
|
* The regions of one HNSW graph that the native search core reads and writes.
|
|
337
1475
|
*
|
|
@@ -395,6 +1533,12 @@ interface NativeStoreMemory {
|
|
|
395
1533
|
codeBlocks: Uint8Array[];
|
|
396
1534
|
/** The blocks of full-precision vectors, in ordinal order, with `null` in place of a block that the store holds no memory for. */
|
|
397
1535
|
vectorBlocks: Array<Uint8Array | null>;
|
|
1536
|
+
/** For each ordinal, the sequence of the write that added its vector. */
|
|
1537
|
+
bornAt: BigInt64Array;
|
|
1538
|
+
/** For each ordinal, the sequence of the write that removed or replaced its document, or 0. */
|
|
1539
|
+
retiredAt: BigInt64Array;
|
|
1540
|
+
/** For each thread slot, the oldest pin that the thread holds plus 1, or 0. */
|
|
1541
|
+
pins: BigInt64Array;
|
|
398
1542
|
}
|
|
399
1543
|
/**
|
|
400
1544
|
* A graph that the native search core has attached.
|
|
@@ -443,13 +1587,222 @@ interface NativeConnectResult {
|
|
|
443
1587
|
/** The count of waiting writers to wake in its first word, followed by their ordinals. */
|
|
444
1588
|
wakes: Int32Array;
|
|
445
1589
|
}
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* The native operations that match stored text and measure search deadlines.
|
|
1593
|
+
*
|
|
1594
|
+
* @internal
|
|
1595
|
+
*/
|
|
1596
|
+
interface NativePatternCore {
|
|
1597
|
+
/**
|
|
1598
|
+
* Adds the ordinals whose stored strings match a pattern to a bitmap.
|
|
1599
|
+
*
|
|
1600
|
+
* @param documents - The field's document ordinals in ascending order.
|
|
1601
|
+
* @param runs - Sorted triples of folded code points from the pattern index.
|
|
1602
|
+
* @param offsets - Each triple's first posting, followed by the terminal posting offset.
|
|
1603
|
+
* @param postings - The ascending document ordinals for each triple.
|
|
1604
|
+
* @param values - The stored field regions in the index's ordinal space.
|
|
1605
|
+
* @param text - The pattern's UTF-16 code units.
|
|
1606
|
+
* @param options - Five words containing the operator, case-fold flag, typo tolerance, preparation-count flag, and matcher byte budget. Operators are 0 equal, 1 prefix, 2 suffix, 3 substring, 4 wildcard, and 5 regular expression. Tolerance is 0, 1, 2, or 3 for automatic selection.
|
|
1607
|
+
* @param meter - Two signed 64-bit words containing the atomic work counter and its non-negative cap.
|
|
1608
|
+
* @param stop - One atomic word containing 0 to continue or 1 to stop.
|
|
1609
|
+
* @param deadline - One unsigned 64-bit monotonic deadline in nanoseconds, or 0 for no deadline.
|
|
1610
|
+
* @param into - Receives matching bits, with at least one word and enough words for every stored ordinal. Output and counter regions must not overlap any input or each other.
|
|
1611
|
+
* @returns 0 on success, or a negative status. Invalid arguments and allocation refusals leave outputs unchanged; stopping or exceeding the work cap may leave partial output.
|
|
1612
|
+
*/
|
|
1613
|
+
patternTest(documents: Uint32Array, runs: Uint32Array, offsets: Uint32Array, postings: Uint32Array, values: NativeStoredValues, text: Uint16Array, options: Uint32Array, meter: BigInt64Array, stop: Uint32Array, deadline: BigUint64Array, into: Uint32Array): number;
|
|
1614
|
+
/**
|
|
1615
|
+
* Writes the current monotonic clock value in nanoseconds.
|
|
1616
|
+
*
|
|
1617
|
+
* @param into - Receives the clock value in its first word, or the largest unsigned 64-bit value if the clock fails.
|
|
1618
|
+
* @returns 0 on success, or a negative status that leaves the output unchanged.
|
|
1619
|
+
*/
|
|
1620
|
+
clockNow(into: BigUint64Array): number;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* The postings and stored positions of one phrase token.
|
|
1625
|
+
*
|
|
1626
|
+
* @internal
|
|
1627
|
+
*/
|
|
1628
|
+
interface NativePhrasePostings {
|
|
1629
|
+
/** Each posting's document ordinal. */
|
|
1630
|
+
documents: Uint32Array;
|
|
1631
|
+
/** Each posting's field index. */
|
|
1632
|
+
fields: Uint16Array;
|
|
1633
|
+
/** Each posting's first position in positions. */
|
|
1634
|
+
positionStarts: Uint32Array;
|
|
1635
|
+
/** Each posting's number of positions. */
|
|
1636
|
+
positionCounts: Uint32Array;
|
|
1637
|
+
/** The stored positions, ascending within each posting. */
|
|
1638
|
+
positions: Uint32Array;
|
|
1639
|
+
/** Whether the postings are already in document order. */
|
|
1640
|
+
ordered: boolean;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* The phrase tokens, searchable fields, and document masks of one segment.
|
|
1644
|
+
*
|
|
1645
|
+
* @internal
|
|
1646
|
+
*/
|
|
1647
|
+
interface NativePhraseRequest {
|
|
1648
|
+
/** The postings of each distinct token, with an empty list for a missing token. */
|
|
1649
|
+
postings: readonly NativePhrasePostings[];
|
|
1650
|
+
/** Each phrase's start in tokens and offsets, followed by the total entry count. */
|
|
1651
|
+
starts: Uint32Array;
|
|
1652
|
+
/** The posting-list index of each phrase token, in phrase order. */
|
|
1653
|
+
tokens: Uint32Array;
|
|
1654
|
+
/** Each token's position relative to the phrase start. */
|
|
1655
|
+
offsets: Uint32Array;
|
|
1656
|
+
/** One for each searchable field, or zero for an excluded field. */
|
|
1657
|
+
searchable: Uint8Array;
|
|
1658
|
+
/** The permitted document ordinals, or null to search every document. */
|
|
1659
|
+
filter: Uint32Array | null;
|
|
1660
|
+
/** The removed document ordinals. */
|
|
1661
|
+
removed: Uint32Array;
|
|
1662
|
+
/** The logical document capacity of the segment. */
|
|
1663
|
+
ordinalCount: number;
|
|
1664
|
+
/** Whether the operation returns each matching document and field. */
|
|
1665
|
+
collect: boolean;
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* The operation that matches positional phrases and counts their work.
|
|
1669
|
+
*
|
|
1670
|
+
* @internal
|
|
1671
|
+
*/
|
|
1672
|
+
interface NativePhraseCore {
|
|
1673
|
+
/**
|
|
1674
|
+
* Finds documents that contain every phrase within a searchable field.
|
|
1675
|
+
*
|
|
1676
|
+
* @param request - The segment postings, phrases, and document masks.
|
|
1677
|
+
* @param meter - The shared int64 work count followed by its cap.
|
|
1678
|
+
* @param stop - One uint32 that is zero until the search stops.
|
|
1679
|
+
* @param deadline - One uint64 clock deadline, or zero for no deadline.
|
|
1680
|
+
* @param matched - Receives the document bitmap, with padding bits cleared.
|
|
1681
|
+
* @param starts - Receives one row offset per phrase in request order, followed by the row count.
|
|
1682
|
+
* @param documents - Receives each matching row's document ordinal.
|
|
1683
|
+
* @param fields - Receives each matching row's field index.
|
|
1684
|
+
* @param frequencies - Receives each matching row's number of phrase starts.
|
|
1685
|
+
* @returns The row count, or a negative status. Invalid requests and short outputs leave every region unchanged.
|
|
1686
|
+
* A work-cap or stop status leaves the output undefined. When collect is true, every row output must hold the sum
|
|
1687
|
+
* of the smallest posting count in each phrase, so that capacity refusal happens before the operation counts work.
|
|
1688
|
+
*/
|
|
1689
|
+
matchPhrases(request: NativePhraseRequest, meter: BigInt64Array, stop: Uint32Array, deadline: BigUint64Array, matched: Uint32Array, starts: Uint32Array, documents: Uint32Array, fields: Uint16Array, frequencies: Uint32Array): number;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
/** The native operations that assemble search results. @internal */
|
|
1693
|
+
interface NativeResultCore {
|
|
1694
|
+
/**
|
|
1695
|
+
* Places pins in a ranking and returns the source position of each entry.
|
|
1696
|
+
*
|
|
1697
|
+
* @param count - The ranked entry count, at most 2^31 - 1.
|
|
1698
|
+
* @param ranked - Each pin's ranked position, or -1 for an absent pin, with at most 2^31 - 1 pins.
|
|
1699
|
+
* @param positions - The requested position of each pin, in request order.
|
|
1700
|
+
* @param depth - Pins at or beyond this depth are skipped, or null to place every pin.
|
|
1701
|
+
* @param output - Receives original ranked positions, or -1 minus the pin's index in the supplied pin arrays.
|
|
1702
|
+
* @returns The entry count, or a negative core status that leaves inputs and output regions unchanged.
|
|
1703
|
+
*/
|
|
1704
|
+
placePinned(count: number, ranked: Int32Array, positions: Uint32Array, depth: number | null, output: Int32Array): number;
|
|
1705
|
+
/**
|
|
1706
|
+
* Merges scored lists by descending score, document ID, and source-list order for ties.
|
|
1707
|
+
*
|
|
1708
|
+
* @param offsets - The start of each list in the flattened arrays, followed by the total entry count.
|
|
1709
|
+
* @param scores - The scores in source-list order, including non-finite scores.
|
|
1710
|
+
* @param idRanks - The document ID ranks, comparable across all lists.
|
|
1711
|
+
* @param limit - The maximum number of entries to return.
|
|
1712
|
+
* @param lists - Receives each entry's source-list position, counting empty lists.
|
|
1713
|
+
* @param indices - Receives each entry's position within its source list.
|
|
1714
|
+
* @returns The count, or a negative core status that leaves inputs and output regions unchanged.
|
|
1715
|
+
*/
|
|
1716
|
+
mergeRankings(offsets: Uint32Array, scores: Float64Array, idRanks: Uint32Array, limit: number, lists: Uint32Array, indices: Uint32Array): number;
|
|
1717
|
+
/**
|
|
1718
|
+
* Merges sorted lists by their shared sort ranks, preserving source-list order for ties.
|
|
1719
|
+
*
|
|
1720
|
+
* @param offsets - The start of each list in the flattened ranks, followed by the total entry count.
|
|
1721
|
+
* @param ranks - The ranks by sort values and document ID, comparable across all lists.
|
|
1722
|
+
* @param limit - The maximum number of entries to return.
|
|
1723
|
+
* @param lists - Receives each entry's source-list position, counting empty lists.
|
|
1724
|
+
* @param indices - Receives each entry's position within its source list.
|
|
1725
|
+
* @returns The count, or a negative core status that leaves inputs and output regions unchanged.
|
|
1726
|
+
*/
|
|
1727
|
+
mergeSorted(offsets: Uint32Array, ranks: Uint32Array, limit: number, lists: Uint32Array, indices: Uint32Array): number;
|
|
1728
|
+
/**
|
|
1729
|
+
* Combines text and vector rankings and writes them in descending score order, and then document ID order for equal scores.
|
|
1730
|
+
*
|
|
1731
|
+
* @param strategy - 0 for reciprocal rank fusion, or 1 for a linear combination.
|
|
1732
|
+
* @param k - The reciprocal rank constant.
|
|
1733
|
+
* @param alpha - The vector weight in a linear combination.
|
|
1734
|
+
* @param textKeys - The candidate keys in the text ranking.
|
|
1735
|
+
* @param textScores - The score at each position of the text ranking.
|
|
1736
|
+
* @param vectorKeys - The candidate keys in the vector ranking.
|
|
1737
|
+
* @param vectorScores - The score at each position of the vector ranking.
|
|
1738
|
+
* @param idRanks - The code point order of document IDs, indexed by candidate key.
|
|
1739
|
+
* @param keys - Receives the fused candidate keys.
|
|
1740
|
+
* @param scores - Receives the fused scores.
|
|
1741
|
+
* @returns The result count, or a negative core status that leaves the output regions unchanged.
|
|
1742
|
+
*/
|
|
1743
|
+
fuse(strategy: number, k: number, alpha: number, textKeys: Uint32Array, textScores: Float64Array, vectorKeys: Uint32Array, vectorScores: Float64Array, idRanks: Uint32Array, keys: Uint32Array, scores: Float64Array): number;
|
|
1744
|
+
/**
|
|
1745
|
+
* Returns the first result after a cursor anchor.
|
|
1746
|
+
*
|
|
1747
|
+
* @param count - The logical result count.
|
|
1748
|
+
* @param sorted - Whether the anchor bitmap alone decides order.
|
|
1749
|
+
* @param scores - Result scores, or null when all are absent.
|
|
1750
|
+
* @param scorePresent - Score validity bits, or null when all supplied scores are present.
|
|
1751
|
+
* @param afterAnchor - Result positions after the anchor by document ID, or by sort values followed by document ID when sorted.
|
|
1752
|
+
* @param anchorScore - The anchor score, or null when absent.
|
|
1753
|
+
* @returns The start position, count when exhausted, or a negative core status.
|
|
1754
|
+
*/
|
|
1755
|
+
pageStart(count: number, sorted: boolean, scores: Float64Array | null, scorePresent: Uint32Array | null, afterAnchor: Uint32Array, anchorScore: number | null): number;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* The analysed synonym rules and the tokens that open each rule.
|
|
1760
|
+
*
|
|
1761
|
+
* @internal
|
|
1762
|
+
*/
|
|
1763
|
+
interface NativeSynonymTable {
|
|
1764
|
+
/** The tokens in UTF-8 and code point order. */
|
|
1765
|
+
tokens: Uint8Array;
|
|
1766
|
+
/** Each token's byte start, followed by the total byte count. */
|
|
1767
|
+
offsets: Uint32Array;
|
|
1768
|
+
/** Each rule's start in ruleTokens, followed by the entry count. */
|
|
1769
|
+
ruleStart: Uint32Array;
|
|
1770
|
+
/** The source token of each one-way rule, or -1 for a two-way rule. */
|
|
1771
|
+
ruleSource: Int32Array;
|
|
1772
|
+
/** The token indexes in each rule. */
|
|
1773
|
+
ruleTokens: Uint32Array;
|
|
1774
|
+
/** Each token's start in tokenRules, followed by the entry count. */
|
|
1775
|
+
tokenStart: Uint32Array;
|
|
1776
|
+
/** The rules that each token opens. */
|
|
1777
|
+
tokenRules: Uint32Array;
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* The operation that expands query tokens through analysed synonym rules.
|
|
1781
|
+
*
|
|
1782
|
+
* @internal
|
|
1783
|
+
*/
|
|
1784
|
+
interface NativeSynonymCore {
|
|
1785
|
+
/**
|
|
1786
|
+
* Shares fifty synonyms among distinct query tokens in query order.
|
|
1787
|
+
*
|
|
1788
|
+
* @param table - The analysed synonym table.
|
|
1789
|
+
* @param units - The query tokens in UTF-16.
|
|
1790
|
+
* @param starts - Each query token's unit start, followed by the total unit count.
|
|
1791
|
+
* @param queries - Receives the input position of each token with synonyms.
|
|
1792
|
+
* @param offsets - Receives each returned group's start in tokens, followed by the total entry count.
|
|
1793
|
+
* @param tokens - Receives each group's token indexes in code point order, without repeats.
|
|
1794
|
+
* @returns The group count, or a negative status that leaves every output unchanged. An empty success writes zero to offsets[0].
|
|
1795
|
+
*/
|
|
1796
|
+
expandSynonyms(table: NativeSynonymTable, units: Uint16Array, starts: Uint32Array, queries: Uint32Array, offsets: Uint32Array, tokens: Uint32Array): number;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
446
1799
|
/**
|
|
447
1800
|
* The operations of the native search core, which each return a status code from the core's header, or, for a
|
|
448
1801
|
* search, the number of candidates found.
|
|
449
1802
|
*
|
|
450
1803
|
* @internal
|
|
451
1804
|
*/
|
|
452
|
-
interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
1805
|
+
interface NativeCore extends NativeAnalysisCore, NativeExpansionCore, NativeKeywordCore, NativeFacetCore, NativeFieldMergeCore, NativeFilterCore, NativeFrozenSegmentCore, NativeGroupCore, NativeHighlightCore, NativePagedCore, NativePatternCore, NativePhraseCore, NativeResultCore, NativeSegmentCore, NativeSegmentMergeCore, NativeSortCore, NativeSynonymCore, NativeTermCore {
|
|
453
1806
|
/** Returns the version of the core's binary interface, which the engine compares with the version that it was built for. */
|
|
454
1807
|
abiVersion(): number;
|
|
455
1808
|
/** Returns the number of bytes that the core's working memory holds. */
|
|
@@ -498,13 +1851,14 @@ interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
|
498
1851
|
* @param query - The query vector.
|
|
499
1852
|
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
500
1853
|
* @param candidateCount - The number of candidates to keep.
|
|
1854
|
+
* @param pin - The write sequence that the search reads the store at, so that it returns only the ordinals that this pin admits.
|
|
501
1855
|
* @param threadSlot - The slot of the calling thread.
|
|
502
1856
|
* @param ordinals - Receives the ordinal of each candidate.
|
|
503
1857
|
* @param distances - Receives the distance of each candidate.
|
|
504
1858
|
* @param accepted - A bit set of the ordinals that a search may return, or `null` to accept every ordinal.
|
|
505
1859
|
* @returns The number of candidates found.
|
|
506
1860
|
*/
|
|
507
|
-
search(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, threadSlot: number, ordinals: Int32Array, distances: Float64Array, accepted: Uint8Array | null): number;
|
|
1861
|
+
search(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, pin: number, threadSlot: number, ordinals: Int32Array, distances: Float64Array, accepted: Uint8Array | null): number;
|
|
508
1862
|
/**
|
|
509
1863
|
* Measures the distance from a query to each of the given ordinals.
|
|
510
1864
|
*
|
|
@@ -513,10 +1867,11 @@ interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
|
513
1867
|
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
514
1868
|
* @param ordinals - The ordinals to measure.
|
|
515
1869
|
* @param count - The number of ordinals to read from `ordinals`.
|
|
1870
|
+
* @param pin - The write sequence that the scores read the store at, so that every ordinal that this pin leaves out scores infinity.
|
|
516
1871
|
* @param distances - Receives one distance for each ordinal.
|
|
517
1872
|
* @returns A status code.
|
|
518
1873
|
*/
|
|
519
|
-
score(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, distances: Float64Array): number;
|
|
1874
|
+
score(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, pin: number, distances: Float64Array): number;
|
|
520
1875
|
/**
|
|
521
1876
|
* Finds the nodes nearest to a query on a native thread, so the calling thread stays free while the core walks
|
|
522
1877
|
* the graph. A core without its own threads leaves this out.
|
|
@@ -526,11 +1881,12 @@ interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
|
526
1881
|
* @param query - The query vector, which the core copies before the promise settles.
|
|
527
1882
|
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
528
1883
|
* @param candidateCount - The number of candidates to keep.
|
|
1884
|
+
* @param pin - The write sequence that the search reads the store at, so that it returns only the ordinals that this pin admits.
|
|
529
1885
|
* @param threadSlot - A slot that no other thread uses until the promise settles.
|
|
530
1886
|
* @param accepted - A bit set of the ordinals that a search may return, or `null` to accept every ordinal.
|
|
531
1887
|
* @returns The candidates found.
|
|
532
1888
|
*/
|
|
533
|
-
searchAsync?(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, threadSlot: number, accepted: Uint8Array | null): Promise<NativeSearchResult>;
|
|
1889
|
+
searchAsync?(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, pin: number, threadSlot: number, accepted: Uint8Array | null): Promise<NativeSearchResult>;
|
|
534
1890
|
/**
|
|
535
1891
|
* Measures the distance from a query to each of the given ordinals on a native thread. A core without its own
|
|
536
1892
|
* threads leaves this out.
|
|
@@ -540,10 +1896,11 @@ interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
|
540
1896
|
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
541
1897
|
* @param ordinals - The ordinals to measure, which the core copies before the promise settles.
|
|
542
1898
|
* @param count - The number of ordinals to read from `ordinals`.
|
|
1899
|
+
* @param pin - The write sequence that the scores read the store at, so that every ordinal that this pin leaves out scores infinity.
|
|
543
1900
|
* @param threadSlot - A slot that no other thread uses until the promise settles.
|
|
544
1901
|
* @returns The status and one distance for each ordinal.
|
|
545
1902
|
*/
|
|
546
|
-
scoreAsync?(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, threadSlot: number): Promise<NativeScoreResult>;
|
|
1903
|
+
scoreAsync?(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, pin: number, threadSlot: number): Promise<NativeScoreResult>;
|
|
547
1904
|
/**
|
|
548
1905
|
* Links a new node into the graph.
|
|
549
1906
|
*
|
|
@@ -628,6 +1985,66 @@ interface NativeCore extends NativeAnalysisCore, NativeKeywordCore {
|
|
|
628
1985
|
quantise(store: NativeStoreHandle, metric: number, ordinals: Int32Array, count: number): number;
|
|
629
1986
|
}
|
|
630
1987
|
|
|
1988
|
+
/**
|
|
1989
|
+
* Makes a language available to indexes that name it.
|
|
1990
|
+
*
|
|
1991
|
+
* English is registered already. Every other language is its own module, so a
|
|
1992
|
+
* bundle carries only what you import. Import the one you want and register
|
|
1993
|
+
* it before you create an index that sets it as `language`.
|
|
1994
|
+
*
|
|
1995
|
+
* @param module - The language module, which registers under its own `name`.
|
|
1996
|
+
* Registering a name again replaces what was there.
|
|
1997
|
+
*
|
|
1998
|
+
* @public
|
|
1999
|
+
*/
|
|
2000
|
+
declare function registerLanguage(module: LanguageModule): void;
|
|
2001
|
+
/**
|
|
2002
|
+
* Returns the language module registered under a name.
|
|
2003
|
+
*
|
|
2004
|
+
* @param name - The name the module registered under.
|
|
2005
|
+
* @returns The registered module.
|
|
2006
|
+
* @throws A `NarsilError` with `LANGUAGE_NOT_SUPPORTED` when nothing holds
|
|
2007
|
+
* that name, which usually means the module was never imported.
|
|
2008
|
+
*
|
|
2009
|
+
* @public
|
|
2010
|
+
*/
|
|
2011
|
+
declare function getLanguage(name: string): LanguageModule;
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* Call this to give the engine the partial-word search code, so that it can
|
|
2015
|
+
* create and load an index with a field whose type includes `partial`.
|
|
2016
|
+
*
|
|
2017
|
+
* A Node process loads that code by itself, so only a browser app has to
|
|
2018
|
+
* make this call. In a browser, import `partialWordSearch` from
|
|
2019
|
+
* `@delali/narsil/partial-words` and pass it here before the app creates or
|
|
2020
|
+
* loads an index with a `partial` field.
|
|
2021
|
+
*
|
|
2022
|
+
* @param module - Pass the `partialWordSearch` object that
|
|
2023
|
+
* `@delali/narsil/partial-words` exports.
|
|
2024
|
+
* @throws The engine throws a `NarsilError` with `CONFIG_INVALID` for any
|
|
2025
|
+
* other object.
|
|
2026
|
+
*
|
|
2027
|
+
* @public
|
|
2028
|
+
*/
|
|
2029
|
+
declare function registerPartialWordSearch(module: PartialWordSearch): void;
|
|
2030
|
+
|
|
2031
|
+
/**
|
|
2032
|
+
* Call this to give the engine its synonym code, so that it can create and
|
|
2033
|
+
* load an index that holds a synonym set.
|
|
2034
|
+
*
|
|
2035
|
+
* A Node process loads that code by itself, so only a browser app has to make
|
|
2036
|
+
* this call. In a browser, import `synonyms` from `@delali/narsil/synonyms` and
|
|
2037
|
+
* pass it here before the app creates or loads an index with a synonym set.
|
|
2038
|
+
*
|
|
2039
|
+
* @param module - Pass the `synonyms` object that `@delali/narsil/synonyms`
|
|
2040
|
+
* exports.
|
|
2041
|
+
* @throws The engine throws a `NarsilError` with `CONFIG_INVALID` for any
|
|
2042
|
+
* other object.
|
|
2043
|
+
*
|
|
2044
|
+
* @public
|
|
2045
|
+
*/
|
|
2046
|
+
declare function registerSynonyms(module: SynonymSearch): void;
|
|
2047
|
+
|
|
631
2048
|
/**
|
|
632
2049
|
* The status of one file or directory in an app's private storage.
|
|
633
2050
|
*
|
|
@@ -908,4 +2325,4 @@ declare function isSimdAvailable(): boolean;
|
|
|
908
2325
|
*/
|
|
909
2326
|
declare const VERSION = "0.1.0";
|
|
910
2327
|
|
|
911
|
-
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, type NativeAnalysisCore, type NativeConnectResult, type NativeCore, type NativeGraphHandle, type NativeGraphMemory, type NativeKeywordCore, type NativeScoreResult, type NativeSearchResult, type NativeStopWordSetHandle, type NativeStoreHandle, type NativeStoreMemory, PartialWordSearch, PatternSearch, type ReactNativeDirectoryEntry, type ReactNativeFileStatus, type ReactNativeFiles, type ReactNativeHost, StopWordOverride, SynonymSearch, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache };
|
|
2328
|
+
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, type NativeAnalysisCore, type NativeConnectResult, type NativeCore, type NativeExpansionCore, type NativeExpansionSegment, type NativeFacetCore, type NativeFieldMergeCore, type NativeFieldMergeRegion, type NativeFieldMergeSource, type NativeFieldTokenArgument, type NativeFieldTokens, type NativeFilterCore, type NativeFilterRegion, type NativeFrozenPagedRemovals, type NativeFrozenRegionArguments, type NativeFrozenRemovalIndex, type NativeFrozenRuns, type NativeFrozenSegment, type NativeFrozenSegmentCore, type NativeFrozenSegmentState, type NativeFrozenStrings, type NativeGraphHandle, type NativeGraphMemory, type NativeGroupCore, type NativeGrowingSegment, type NativeHighlightCore, type NativeHighlightQuery, type NativeKeywordCore, type NativeKeywordMergeInput, type NativeKeywordMergeOutput, type NativePageCache, type NativePageSection, type NativePagedCore, type NativePagedFileHandle, type NativePagedGraphPart, type NativePagedVectorField, type NativePagedVectorFile, type NativePagedVectorRequest, type NativePartialExpansionCore, type NativePartialRequest, type NativePartialSource, type NativePatternCore, type NativePhraseCore, type NativePhrasePostings, type NativePhraseRequest, type NativePositionPool, type NativePostingMergeOutput, type NativePostingPool, type NativeResultCore, type NativeRunTable, type NativeScoreResult, type NativeSearchResult, type NativeSegmentCore, type NativeSegmentMergeCore, type NativeSliceAllocator, type NativeSortColumn, type NativeSortCore, type NativeSortValues, type NativeSpellingTable, type NativeStopWordSetHandle, type NativeStoreHandle, type NativeStoreMemory, NativeStoredValues, type NativeSurfaceTable, type NativeSynonymCore, type NativeSynonymTable, type NativeTermColumns, type NativeTermCore, type NativeTermDictionary, type NativeTermTable, PartialWordSearch, PatternSearch, type ReactNativeDirectoryEntry, type ReactNativeFileStatus, type ReactNativeFiles, type ReactNativeHost, StopWordOverride, SynonymSearch, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache };
|