@delali/narsil 0.3.1-next.153 → 0.3.1-next.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/{analysis-change-2OYM7ARW.mjs → analysis-change-3TFIHT5E.mjs} +32 -23
- package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-TC36BU47.mjs} +39 -10
- package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
- package/dist/browser/chunk-23XRXIBW.mjs +85 -0
- package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
- package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-4EWUGZYZ.mjs} +4 -4
- package/dist/browser/chunk-4WCVMOU3.mjs +151 -0
- package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-56W3HQVJ.mjs} +9 -150
- package/dist/{react-native/chunks/chunk-VGUWIZFQ.mjs → browser/chunk-5TCXK5SB.mjs} +2 -2
- package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/chunk-A5KUEGDY.mjs +241 -0
- package/dist/browser/{chunk-HT7J73QL.mjs → chunk-ABCXENU5.mjs} +2 -2
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/browser/chunk-BXM5XOCA.mjs +315 -0
- package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
- package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
- package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
- package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-EXQZGUQH.mjs} +2 -79
- package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-FNIFPFB7.mjs} +5 -31
- package/dist/browser/chunk-G64Q6OJF.mjs +96 -0
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
- package/dist/browser/chunk-JIJXMI42.mjs +1829 -0
- package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
- package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-K4GCSZLI.mjs} +15 -6
- package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-K5AXJBLL.mjs} +6 -5
- package/dist/browser/chunk-KKAMCABR.mjs +432 -0
- package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-LFIWRCEA.mjs} +1 -159
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
- package/dist/browser/chunk-NLWTBAGB.mjs +111 -0
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
- package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-RND5CLX3.mjs} +147 -253
- package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-RQBUNZQW.mjs} +2 -2
- package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-RRO3EV4C.mjs} +9 -8
- package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-SMEQ36NT.mjs} +162 -2019
- package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-SRMZXJSL.mjs} +8 -1
- package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SUDNZKPL.mjs} +2 -2
- package/dist/browser/{chunk-LURXVCHG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
- package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-XY4VVBBO.mjs} +3 -2
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
- package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-NEUGHUPA.mjs} +21 -14
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-CVGPRO6D.mjs} +1299 -881
- package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
- package/dist/browser/import-OM6QAW45.mjs +18 -0
- package/dist/browser/methods-KTQCSIN4.mjs +30 -0
- package/dist/browser/{module-XQLEOYNM.mjs → module-3HNFCBJ5.mjs} +10 -8
- package/dist/browser/{module-KAMRAJLE.mjs → module-E33X4AOK.mjs} +17 -10
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
- package/dist/browser/{pool-DTYSPBMQ.mjs → pool-3JLET5RO.mjs} +3 -2
- package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
- package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
- package/dist/browser/retention-ASWUHAYI.mjs +209 -0
- package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-PN7ZW6Q4.mjs} +80 -315
- package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
- package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
- package/dist/browser/{write-I5P5MW4O.mjs → write-HMDYCTV2.mjs} +17 -11
- package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-Da4ywVVl.d.ts} +94 -7
- package/dist/{chunk-LDGGR7YT.mjs → chunk-2MANFZJ3.mjs} +2 -2
- package/dist/{chunk-IZT3G24Q.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/{chunk-3TVDTACC.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/chunk-3HB3PEC6.mjs +240 -0
- package/dist/chunk-3HHQLEEQ.mjs +1092 -0
- package/dist/chunk-3OH67G7R.mjs +214 -0
- package/dist/{chunk-ZS6CMXAE.mjs → chunk-3R4UZWQG.mjs} +98 -250
- package/dist/{chunk-65WCV5JO.mjs → chunk-4BYWRYPM.mjs} +1 -1
- package/dist/{chunk-SOUZMPME.mjs → chunk-4KRC2APY.mjs} +7 -194
- package/dist/{chunk-5QMHMELB.mjs → chunk-5FLRXF73.mjs} +8 -1
- package/dist/chunk-5FVU47TB.mjs +20 -0
- package/dist/chunk-5YNRKI2C.mjs +81 -0
- package/dist/chunk-6L3XJXGU.mjs +470 -0
- package/dist/chunk-6MSZ543Y.mjs +32 -0
- package/dist/{chunk-T4CJDBBE.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{chunk-3SBJVQLL.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/chunk-7GXJUJ24.mjs +49 -0
- package/dist/{chunk-FNBNZCGP.mjs → chunk-AILVAOLX.mjs} +2 -2
- package/dist/chunk-BDRIVYOK.mjs +72 -0
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/chunk-BY6ZDGYS.mjs +50 -0
- package/dist/{chunk-5WB2A3XU.mjs → chunk-DCNKVEDB.mjs} +511 -27
- package/dist/{chunk-NITCPDFL.mjs → chunk-DIBHI6W5.mjs} +2 -2
- package/dist/{chunk-4QCSHLNM.mjs → chunk-DUOLGBTE.mjs} +3 -3
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/chunk-GH4WQ22V.mjs +34 -0
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/chunk-H4KHPLHJ.mjs +382 -0
- package/dist/{chunk-7TE2AJIH.mjs → chunk-H6VIGE62.mjs} +13 -10
- package/dist/{chunk-J7M73VY7.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-DGRM4EZZ.mjs → chunk-HNVVEQP7.mjs} +1 -1
- package/dist/{chunk-RBEHLIKX.mjs → chunk-HW5TNXBO.mjs} +35 -11
- package/dist/{chunk-KYVRZAYP.mjs → chunk-I54T6CQP.mjs} +2 -69
- package/dist/{chunk-IRWP524D.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/chunk-IPN7S4KX.mjs +130 -0
- package/dist/{chunk-CSHHU7PA.mjs → chunk-J4IWBIVY.mjs} +11 -30
- package/dist/{chunk-G5KHSM6E.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-6RKSY3BX.mjs → chunk-KBDBPVLN.mjs} +5 -5
- package/dist/{chunk-J4BDAH2W.mjs → chunk-KBKEXQZA.mjs} +2 -2
- package/dist/{chunk-IJSFWGVW.mjs → chunk-KFLK5NA2.mjs} +3 -3
- package/dist/{chunk-YGQOPB2Z.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/chunk-KJ3RTZDJ.mjs +101 -0
- package/dist/{chunk-2PNYKG2D.mjs → chunk-KMUNHGBQ.mjs} +139 -432
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-VP6XRMWR.mjs → chunk-KPIV4RUC.mjs} +6 -32
- package/dist/{chunk-NPXVQS33.mjs → chunk-KXCVQWOR.mjs} +4 -3
- package/dist/chunk-KYYABCSW.mjs +72 -0
- package/dist/{chunk-6F6USYII.mjs → chunk-L7ZD4L3K.mjs} +267 -265
- package/dist/{chunk-U46IZNCW.mjs → chunk-LC3FDWTX.mjs} +3 -2
- package/dist/{chunk-6BWLDLS3.mjs → chunk-LHKOSI2J.mjs} +1 -1
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-MP7ABPTD.mjs} +12 -2
- package/dist/chunk-MT2NRTA6.mjs +216 -0
- package/dist/chunk-NF4DT3IH.mjs +85 -0
- package/dist/{chunk-POUYICOU.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/{chunk-SEAJS664.mjs → chunk-PCRA7HTI.mjs} +5 -5
- package/dist/chunk-PHQNACDT.mjs +63 -0
- package/dist/chunk-Q622CTMC.mjs +74 -0
- package/dist/{chunk-NVTFQFUL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
- package/dist/chunk-QDZJM7NI.mjs +23 -0
- package/dist/{chunk-52QQWEBS.mjs → chunk-QH3YIQP4.mjs} +36 -7
- package/dist/chunk-QJVOLKU6.mjs +111 -0
- package/dist/chunk-QUJHMPTP.mjs +30 -0
- package/dist/{chunk-3E4RRF5J.mjs → chunk-RSVULW4Q.mjs} +100 -8
- package/dist/{chunk-IJPK5PGM.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/chunk-RZWWB2XR.mjs +96 -0
- package/dist/{chunk-KQJVNPRM.mjs → chunk-S2EQU2GE.mjs} +19 -16
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/{chunk-LJ4ENXOD.mjs → chunk-SG3JBNHY.mjs} +2 -2
- package/dist/{chunk-B2FTZNNF.mjs → chunk-SMVH6JBE.mjs} +34 -14
- package/dist/chunk-SY3EWKQY.mjs +242 -0
- package/dist/{chunk-NYSONUB7.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-ZHAXP7SD.mjs → chunk-U4BS74YN.mjs} +26 -238
- package/dist/chunk-UHICS3JI.mjs +83 -0
- package/dist/chunk-UZRZKNNZ.mjs +101 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/{chunk-TTCKT2RT.mjs → chunk-VGF7CFRP.mjs} +134 -11
- package/dist/chunk-VHBNF4MA.mjs +543 -0
- package/dist/{chunk-AWNHDBKV.mjs → chunk-VQEUR6T6.mjs} +16 -8
- package/dist/chunk-WQRN64Q6.mjs +196 -0
- package/dist/{chunk-DMNPYF54.mjs → chunk-WZ7YV54N.mjs} +2 -2
- package/dist/chunk-Y4WPNHMC.mjs +50 -0
- package/dist/{chunk-2HJWQPR6.mjs → chunk-YEDIDCR7.mjs} +6 -122
- package/dist/chunk-YEKL4JBK.mjs +96 -0
- package/dist/{chunk-UGVUW27S.mjs → chunk-Z2BE2MAM.mjs} +14 -10
- package/dist/{chunk-3HV7M5OJ.mjs → chunk-ZAUJFLEN.mjs} +11 -135
- package/dist/{chunk-FDG4KXX5.mjs → chunk-ZHCUZZE5.mjs} +6 -4
- package/dist/chunk-ZTW5WTGG.mjs +167 -0
- package/dist/chunk-ZYAY26KG.mjs +29 -0
- package/dist/{client-Cn3gNxUU.d.ts → client-DRv7UVeY.d.ts} +193 -11
- package/dist/client.d.ts +9 -7
- package/dist/client.mjs +120 -7
- package/dist/{cold-module-PYSSBIL7.mjs → cold-module-7XXCEGTZ.mjs} +43 -33
- package/dist/config-CoSig5Ox.d.ts +482 -0
- package/dist/{config-CfhH1IWQ.d.ts → config-DMwffLKn.d.ts} +20 -5
- package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-G5TK7NLA.mjs} +18 -13
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +4 -4
- package/dist/distribution/transport/in-memory.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +3 -3
- package/dist/distribution.d.ts +41 -9
- package/dist/distribution.mjs +9304 -7271
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-NCKUC5EO.mjs} +1293 -872
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{config-aIsy7mcL.d.ts → engine-CFxPYqEk.d.ts} +716 -407
- package/dist/engine-hooks-DHCMOADY.mjs +47 -0
- package/dist/{import-GJOMB2HC.mjs → import-NBFXFCSG.mjs} +32 -24
- package/dist/{index-MsF7e5hL.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +9 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +29 -21
- package/dist/index.react-native.mjs +19 -12
- package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-J4DVRM4A.mjs} +33 -19
- package/dist/methods-7IOINERF.mjs +30 -0
- package/dist/{module-6RLIKSZQ.mjs → module-DWKPBSMN.mjs} +38 -28
- package/dist/{module-AVQEIB7O.mjs → module-UN76TF7I.mjs} +14 -14
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-DPNWVSK2.mjs} +46 -31
- package/dist/partial-words.mjs +7 -5
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +40 -29
- package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
- package/dist/{pool-UPV5PVPY.mjs → pool-Y4A46T36.mjs} +2 -2
- package/dist/query-suggestions/merge-worker.d.ts +55 -0
- package/dist/query-suggestions/merge-worker.mjs +81 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +246 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +62 -0
- package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-6BPDPH6K.mjs} +50 -19
- package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
- package/dist/react-native/chunks/chunk-3JIBF3XT.mjs +191 -0
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
- package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-4DII3ZSM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-4J74WHQM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-4LCEN2IU.mjs +315 -0
- package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-4Y53T4YE.mjs} +6 -190
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
- package/dist/react-native/chunks/chunk-6WA3C3DV.mjs +85 -0
- package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
- package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7PXRWYUU.mjs} +1 -1
- package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-ALOIBXWN.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-C3PTWYKT.mjs} +10 -153
- package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-C5G6TJ7A.mjs} +2 -69
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
- package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-CKNRFDTZ.mjs} +1 -1
- package/dist/react-native/chunks/chunk-CUH5F57W.mjs +242 -0
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
- package/dist/{browser/chunk-55WYRLDZ.mjs → react-native/chunks/chunk-DVDX4SDR.mjs} +2 -2
- package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +12 -2
- package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-EIOYM5TO.mjs} +17 -9
- package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
- package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
- package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-GJFXPHXI.mjs} +5 -4
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-HUOYZJ3Q.mjs} +140 -430
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +111 -0
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
- package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-JLIIWJUV.mjs} +2 -2
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
- package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-KTTAU63H.mjs} +5 -5
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
- package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +2 -79
- package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-MJDQU5MW.mjs} +4 -30
- package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-N2WUOWLL.mjs} +12 -10
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
- package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-OL3WDV53.mjs} +7 -33
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
- package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-PEHS2UO3.mjs} +7 -6
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
- package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +96 -0
- package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
- package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
- package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-VXGE4ZXL.mjs} +151 -257
- package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-WBYQRHDY.mjs} +2 -2
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +288 -0
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-5PHF6DZR.mjs} +31 -22
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-KO565FZC.mjs} +1309 -889
- package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
- package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
- package/dist/react-native/chunks/methods-6W5U4C3H.mjs +30 -0
- package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-H5MVPSP2.mjs} +13 -11
- package/dist/react-native/chunks/module-ZL5ZG6YB.mjs +34 -0
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
- package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-JR3NJCAF.mjs} +3 -2
- package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
- package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
- package/dist/react-native/chunks/retention-7I7UAWYK.mjs +221 -0
- package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-EZYB6SLF.mjs} +90 -323
- package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
- package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-JUESXHDL.mjs} +27 -19
- package/dist/react-native/partial-words.mjs +8 -5
- package/dist/react-native/pattern.mjs +4 -3
- package/dist/react-native/query-suggestions.mjs +258 -0
- package/dist/react-native/sync.mjs +2299 -0
- package/dist/react-native/synonyms.mjs +7 -4
- package/dist/react.d.ts +11 -10
- package/dist/react.mjs +8 -1
- package/dist/{rerank-3W54N6P2.mjs → rerank-MQ37IYRV.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
- package/dist/restore-queue-JVGENGGE.mjs +55 -0
- package/dist/retention-HROPV2QU.mjs +59 -0
- package/dist/{runtime-L2DZYY6N.mjs → runtime-COIUORCN.mjs} +5 -5
- package/dist/{schema-D33CyXCy.d.ts → schema-Jwt928nJ.d.ts} +1 -1
- package/dist/server.d.ts +119 -20
- package/dist/server.mjs +1123 -58
- package/dist/{snapshot-WMX6JCLP.mjs → snapshot-4HS2G2UM.mjs} +106 -49
- package/dist/start-UTWHGH42.mjs +59 -0
- package/dist/sync/filesystem.d.ts +30 -0
- package/dist/sync/filesystem.mjs +271 -0
- package/dist/sync/indexeddb.d.ts +30 -0
- package/dist/sync/indexeddb.mjs +237 -0
- package/dist/sync-state-ZWHLAFLE.mjs +15 -0
- package/dist/sync.browser.mjs +2294 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2268 -0
- package/dist/synonyms.mjs +6 -4
- package/dist/{tasks-C4ElXr4P.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/thread-6MOXY2KD.mjs +45 -0
- package/dist/types-BZCGjfLn.d.ts +227 -0
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +7 -7
- package/dist/workers/entry.mjs +8 -8
- package/dist/{write-SKJ6HW7O.mjs → write-GTTWWRRG.mjs} +36 -28
- package/openapi.json +912 -5
- package/package.json +45 -8
- package/dist/browser/import-QOY6ZH6X.mjs +0 -12
- package/dist/browser/restore-queue-UQ6AAUVX.mjs +0 -41
- package/dist/chunk-7LDMWKP6.mjs +0 -209
- package/dist/engine-CJRUHXgf.d.ts +0 -664
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
- package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
- package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
- package/dist/react-native/chunks/restore-queue-H5VCN453.mjs +0 -41
- package/dist/restore-queue-AOF5OTQV.mjs +0 -41
- package/dist/thread-I7DVHHW7.mjs +0 -31
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, e as ScoringMode, a as IndexConfig } from './schema-
|
|
1
|
+
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
2
|
+
import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, e as ScoringMode, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-Jwt928nJ.js';
|
|
3
|
+
import { h as QuerySuggestionsBuildEvent, j as QuerySuggestionsWarningEvent } from './query-suggestions-CBYkrQ5T.js';
|
|
4
|
+
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Every code a {@link NarsilError} carries, grouped by the part of the engine
|
|
@@ -45,6 +47,12 @@ declare const ErrorCodes: {
|
|
|
45
47
|
readonly BACKUP_STORE_CLAIMED: "BACKUP_STORE_CLAIMED";
|
|
46
48
|
readonly BACKUP_STORE_NOT_CONFIGURED: "BACKUP_STORE_NOT_CONFIGURED";
|
|
47
49
|
readonly BACKUP_NOT_READY: "BACKUP_NOT_READY";
|
|
50
|
+
readonly SYNC_DURABILITY_REQUIRED: "SYNC_DURABILITY_REQUIRED";
|
|
51
|
+
readonly SYNC_BACKUP_STORE_REQUIRED: "SYNC_BACKUP_STORE_REQUIRED";
|
|
52
|
+
readonly SYNC_NOT_READY: "SYNC_NOT_READY";
|
|
53
|
+
readonly SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED";
|
|
54
|
+
readonly SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING";
|
|
55
|
+
readonly QUERY_SUGGESTIONS_NOT_ENABLED: "QUERY_SUGGESTIONS_NOT_ENABLED";
|
|
48
56
|
readonly SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD";
|
|
49
57
|
readonly VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH";
|
|
50
58
|
readonly SEARCH_INVALID_FILTER: "SEARCH_INVALID_FILTER";
|
|
@@ -175,8 +183,10 @@ type ServerErrorCode = (typeof ServerErrorCodes)[keyof typeof ServerErrorCodes];
|
|
|
175
183
|
* a server, or where the caller cannot read the answer.
|
|
176
184
|
*
|
|
177
185
|
* The HTTP client raises the first five. The React bindings raise
|
|
178
|
-
* `CLIENT_UNEXPECTED_ERROR` alone, which reports a fault inside a hook.
|
|
179
|
-
*
|
|
186
|
+
* `CLIENT_UNEXPECTED_ERROR` alone, which reports a fault inside a hook. A
|
|
187
|
+
* synced device raises `SYNC_ANALYSIS_UNAVAILABLE` before it downloads a
|
|
188
|
+
* snapshot whose language, tokeniser, or stop words it has not registered,
|
|
189
|
+
* and it keeps its copy of the index. No server sends any of them, so a failure under one means the exchange broke
|
|
180
190
|
* before the operation ran. `STATUS_BY_CODE` in `src/server/errors.ts`
|
|
181
191
|
* therefore maps none of them, because no request can arrive under one and no
|
|
182
192
|
* HTTP status belongs to one.
|
|
@@ -190,6 +200,7 @@ declare const ClientErrorCodes: {
|
|
|
190
200
|
readonly CLIENT_INVALID_RESPONSE: "CLIENT_INVALID_RESPONSE";
|
|
191
201
|
readonly CLIENT_TASK_TIMEOUT: "CLIENT_TASK_TIMEOUT";
|
|
192
202
|
readonly CLIENT_UNEXPECTED_ERROR: "CLIENT_UNEXPECTED_ERROR";
|
|
203
|
+
readonly SYNC_ANALYSIS_UNAVAILABLE: "SYNC_ANALYSIS_UNAVAILABLE";
|
|
193
204
|
};
|
|
194
205
|
/**
|
|
195
206
|
* Any one of the codes in {@link ClientErrorCodes}.
|
|
@@ -559,7 +570,7 @@ interface SuggestResult {
|
|
|
559
570
|
}
|
|
560
571
|
/**
|
|
561
572
|
* The state of one vector field, and what maintenance would cost, as
|
|
562
|
-
* {@link
|
|
573
|
+
* {@link VectorMaintenanceOperations.vectorMaintenanceStatus} reports it.
|
|
563
574
|
*
|
|
564
575
|
* Removing a vector leaves a tombstone in the graph, and enough of them slow a
|
|
565
576
|
* search down. Read this to decide when compaction earns its cost.
|
|
@@ -592,9 +603,9 @@ interface VectorMaintenanceResult {
|
|
|
592
603
|
* background, during which a search reads them from the field's files.
|
|
593
604
|
*/
|
|
594
605
|
loadingFromFiles: boolean;
|
|
595
|
-
/** {@link
|
|
606
|
+
/** {@link VectorMaintenanceOperations.compactVectors} would take about this many milliseconds. */
|
|
596
607
|
estimatedCompactMs: number;
|
|
597
|
-
/** {@link
|
|
608
|
+
/** {@link VectorMaintenanceOperations.optimizeVectors} would take about this many milliseconds. */
|
|
598
609
|
estimatedOptimizeMs: number;
|
|
599
610
|
}
|
|
600
611
|
/**
|
|
@@ -1481,170 +1492,6 @@ interface HighlightConfig {
|
|
|
1481
1492
|
maxSnippetLength?: number;
|
|
1482
1493
|
}
|
|
1483
1494
|
|
|
1484
|
-
/**
|
|
1485
|
-
* Hooks that the engine calls alongside its own work, so that an application
|
|
1486
|
-
* can add validation, auditing, enrichment, or metrics without forking the
|
|
1487
|
-
* engine.
|
|
1488
|
-
*
|
|
1489
|
-
* Every hook is optional. A `before` hook fires first and rejects the
|
|
1490
|
-
* operation by throwing, while an `after` hook fires once the operation
|
|
1491
|
-
* succeeds. Where a `before` hook on a write throws a {@link NarsilError}, the
|
|
1492
|
-
* engine passes that error to the caller unchanged. It turns any other error
|
|
1493
|
-
* into `DOC_VALIDATION_FAILED` with the same message, for a single write and
|
|
1494
|
-
* for each entry of a batch alike. The engine awaits a hook that returns a
|
|
1495
|
-
* promise, so slow work in one hook slows every write or search that it
|
|
1496
|
-
* covers.
|
|
1497
|
-
*
|
|
1498
|
-
* @public
|
|
1499
|
-
*/
|
|
1500
|
-
interface NarsilPlugin {
|
|
1501
|
-
/** This name identifies the plugin in errors and in event payloads. */
|
|
1502
|
-
name: string;
|
|
1503
|
-
/** Fires before the engine indexes a document. Throw to reject the write. */
|
|
1504
|
-
beforeInsert?(ctx: InsertContext): void | Promise<void>;
|
|
1505
|
-
/** Fires once the engine has indexed a document. */
|
|
1506
|
-
afterInsert?(ctx: InsertContext): void | Promise<void>;
|
|
1507
|
-
/** Fires before the engine removes a document. Throw to reject the removal. */
|
|
1508
|
-
beforeRemove?(ctx: RemoveContext): void | Promise<void>;
|
|
1509
|
-
/** Fires once the engine has removed a document. */
|
|
1510
|
-
afterRemove?(ctx: RemoveContext): void | Promise<void>;
|
|
1511
|
-
/** Fires before the engine replaces a document. Throw to reject the update. */
|
|
1512
|
-
beforeUpdate?(ctx: UpdateContext): void | Promise<void>;
|
|
1513
|
-
/** Fires once the engine has replaced a document. */
|
|
1514
|
-
afterUpdate?(ctx: UpdateContext): void | Promise<void>;
|
|
1515
|
-
/**
|
|
1516
|
-
* Fires before every search, and before every preflight. Throw to reject the
|
|
1517
|
-
* query. It fires before the engine embeds a `vector.text` query, so a hook
|
|
1518
|
-
* that counts or refuses work stops the call to the embedding provider, and
|
|
1519
|
-
* `ctx.params.vector` still holds the text that the caller passed.
|
|
1520
|
-
* {@link Narsil.suggest} scans the term dictionary and searches no document,
|
|
1521
|
-
* so it fires no hook.
|
|
1522
|
-
*/
|
|
1523
|
-
beforeSearch?(ctx: SearchContext): void | Promise<void>;
|
|
1524
|
-
/**
|
|
1525
|
-
* Fires once a search returns. The context holds a copy of the results, so a
|
|
1526
|
-
* change that you make here leaves the caller's own result untouched. Where
|
|
1527
|
-
* this hook throws, the engine logs a warning and answers the query all the
|
|
1528
|
-
* same, because the search is already over.
|
|
1529
|
-
*/
|
|
1530
|
-
afterSearch?(ctx: SearchContext): void | Promise<void>;
|
|
1531
|
-
/**
|
|
1532
|
-
* Fires once the engine creates an index, and a `restore` fires it too,
|
|
1533
|
-
* because a restore recreates the index that it replaces. Where this hook
|
|
1534
|
-
* throws, the engine logs a warning and keeps the index, because the hook
|
|
1535
|
-
* fires after the index exists.
|
|
1536
|
-
*/
|
|
1537
|
-
onIndexCreate?(ctx: IndexContext): void | Promise<void>;
|
|
1538
|
-
/**
|
|
1539
|
-
* Fires once the engine drops an index, and a `restore` fires it too,
|
|
1540
|
-
* because a restore drops the index that it replaces. Where this hook
|
|
1541
|
-
* throws, the engine logs a warning, because the hook fires after the index
|
|
1542
|
-
* is gone.
|
|
1543
|
-
*/
|
|
1544
|
-
onIndexDrop?(ctx: IndexContext): void | Promise<void>;
|
|
1545
|
-
/**
|
|
1546
|
-
* Fires once {@link Narsil.rebalance} moves an index onto a new partition
|
|
1547
|
-
* count, which is the only way that the count changes. An index opens with
|
|
1548
|
-
* the count that `partitions.maxPartitions` sets, because the engine adds no
|
|
1549
|
-
* partition on its own. Subscribe to the `partitionWatermark` event to learn
|
|
1550
|
-
* when an index fills its capacity.
|
|
1551
|
-
*/
|
|
1552
|
-
onPartitionSplit?(ctx: PartitionContext): void | Promise<void>;
|
|
1553
|
-
/** Fires once the engine loads worker copies of its indexes. */
|
|
1554
|
-
onWorkerPromote?(ctx: WorkerContext): void | Promise<void>;
|
|
1555
|
-
}
|
|
1556
|
-
/**
|
|
1557
|
-
* What a plugin receives around an insert.
|
|
1558
|
-
*
|
|
1559
|
-
* @public
|
|
1560
|
-
*/
|
|
1561
|
-
interface InsertContext {
|
|
1562
|
-
/** The engine writes the document to this index. */
|
|
1563
|
-
indexName: string;
|
|
1564
|
-
/** The document is stored under this id, which the engine resolves before the `before` hook runs. */
|
|
1565
|
-
docId: string;
|
|
1566
|
-
/** This is the document itself, and the engine indexes whatever a `before` hook leaves here. */
|
|
1567
|
-
document: AnyDocument;
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* What a plugin receives around a removal.
|
|
1571
|
-
*
|
|
1572
|
-
* @public
|
|
1573
|
-
*/
|
|
1574
|
-
interface RemoveContext {
|
|
1575
|
-
/** The engine removes the document from this index. */
|
|
1576
|
-
indexName: string;
|
|
1577
|
-
/** The engine removes this document. */
|
|
1578
|
-
docId: string;
|
|
1579
|
-
}
|
|
1580
|
-
/**
|
|
1581
|
-
* What a plugin receives around an update.
|
|
1582
|
-
*
|
|
1583
|
-
* @public
|
|
1584
|
-
*/
|
|
1585
|
-
interface UpdateContext {
|
|
1586
|
-
/** The document belongs to this index. */
|
|
1587
|
-
indexName: string;
|
|
1588
|
-
/** The engine replaces this document. */
|
|
1589
|
-
docId: string;
|
|
1590
|
-
/** The index holds this document before the update. */
|
|
1591
|
-
oldDocument: AnyDocument;
|
|
1592
|
-
/** This document replaces it, and the engine indexes whatever a `before` hook leaves here. */
|
|
1593
|
-
newDocument: AnyDocument;
|
|
1594
|
-
}
|
|
1595
|
-
/**
|
|
1596
|
-
* What a plugin receives around a search.
|
|
1597
|
-
*
|
|
1598
|
-
* @public
|
|
1599
|
-
*/
|
|
1600
|
-
interface SearchContext {
|
|
1601
|
-
/** The search runs against this index. */
|
|
1602
|
-
indexName: string;
|
|
1603
|
-
/** These are the parameters the query runs with, and a `before` hook that changes them rewrites the search. */
|
|
1604
|
-
params: QueryParams;
|
|
1605
|
-
/**
|
|
1606
|
-
* These are the results, which an `after` hook alone receives. A preflight
|
|
1607
|
-
* fires `beforeSearch` and stops there, because it answers with a count and
|
|
1608
|
-
* no hits. Read this field inside an `afterSearch` hook alone.
|
|
1609
|
-
*/
|
|
1610
|
-
results?: QueryResult;
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* What a plugin receives when the engine creates or drops an index.
|
|
1614
|
-
*
|
|
1615
|
-
* @public
|
|
1616
|
-
*/
|
|
1617
|
-
interface IndexContext {
|
|
1618
|
-
/** The engine creates or drops this index. */
|
|
1619
|
-
indexName: string;
|
|
1620
|
-
/** The index holds this configuration. */
|
|
1621
|
-
config: IndexConfig;
|
|
1622
|
-
}
|
|
1623
|
-
/**
|
|
1624
|
-
* What a plugin receives when a rebalance changes an index's partition count.
|
|
1625
|
-
*
|
|
1626
|
-
* @public
|
|
1627
|
-
*/
|
|
1628
|
-
interface PartitionContext {
|
|
1629
|
-
/** The rebalance moved this index. */
|
|
1630
|
-
indexName: string;
|
|
1631
|
-
/** The index held this many partitions before the rebalance. */
|
|
1632
|
-
oldPartitionCount: number;
|
|
1633
|
-
/** The index holds this many partitions now. */
|
|
1634
|
-
newPartitionCount: number;
|
|
1635
|
-
}
|
|
1636
|
-
/**
|
|
1637
|
-
* What a plugin receives when the engine moves onto worker threads.
|
|
1638
|
-
*
|
|
1639
|
-
* @public
|
|
1640
|
-
*/
|
|
1641
|
-
interface WorkerContext {
|
|
1642
|
-
/** The pool holds this many workers. */
|
|
1643
|
-
workerCount: number;
|
|
1644
|
-
/** The engine promoted for this reason, such as the threshold that the index crossed. */
|
|
1645
|
-
reason: string;
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
1495
|
/**
|
|
1649
1496
|
* Snapshot of V8 heap usage as reported by `process.memoryUsage()`, with the
|
|
1650
1497
|
* limit the heap may grow to. All values are bytes. `null` in environments
|
|
@@ -1941,6 +1788,17 @@ type NarsilEventMap = {
|
|
|
1941
1788
|
/** This is the error that the adapter threw. */
|
|
1942
1789
|
error: Error;
|
|
1943
1790
|
};
|
|
1791
|
+
/**
|
|
1792
|
+
* A popular query suggestions build started, completed, failed, or skipped.
|
|
1793
|
+
* The payload carries counts alone, never a phrase.
|
|
1794
|
+
*/
|
|
1795
|
+
querySuggestionsBuild: QuerySuggestionsBuildEvent;
|
|
1796
|
+
/**
|
|
1797
|
+
* The engine skipped a history file, failed to save the counts of a day,
|
|
1798
|
+
* reached a daily limit, or holds an index with the feature on while it has
|
|
1799
|
+
* no key. The payload carries no search text.
|
|
1800
|
+
*/
|
|
1801
|
+
querySuggestionsWarning: QuerySuggestionsWarningEvent;
|
|
1944
1802
|
};
|
|
1945
1803
|
/**
|
|
1946
1804
|
* This map holds a listener for any event of {@link NarsilEventMap}, so that
|
|
@@ -1953,297 +1811,748 @@ type NarsilEventHandlers = {
|
|
|
1953
1811
|
};
|
|
1954
1812
|
|
|
1955
1813
|
/**
|
|
1956
|
-
*
|
|
1957
|
-
*
|
|
1958
|
-
*
|
|
1959
|
-
*
|
|
1960
|
-
*
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
/**
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
embedding?: EmbeddingAdapter;
|
|
1978
|
-
/** Named adapters; names persist in index metadata so recovery can rebind. */
|
|
1979
|
-
embeddingAdapters?: Record<string, EmbeddingAdapter>;
|
|
1980
|
-
/**
|
|
1981
|
-
* These rerank adapters are registered under their keys, so that a query
|
|
1982
|
-
* can give a key in `rerank.adapter`. The engine throws
|
|
1983
|
-
* `RERANK_CONFIG_INVALID` for an empty key and for an entry without a
|
|
1814
|
+
* Registers the adapters that indexes and queries reach by name, which is
|
|
1815
|
+
* what lets a binding outlive a restart and reach a worker thread or another
|
|
1816
|
+
* node.
|
|
1817
|
+
*
|
|
1818
|
+
* @public
|
|
1819
|
+
*/
|
|
1820
|
+
interface AdapterRegistrationOperations {
|
|
1821
|
+
/**
|
|
1822
|
+
* Registers an embedding adapter under a name that an index config can
|
|
1823
|
+
* give and that durability metadata keeps. Registering a name again binds
|
|
1824
|
+
* every index that gives that name to the new adapter.
|
|
1825
|
+
*
|
|
1826
|
+
* @param name - The name that an index config gives in `embedding.adapter`.
|
|
1827
|
+
* @param adapter - The adapter that embeds documents and queries.
|
|
1828
|
+
*/
|
|
1829
|
+
registerEmbeddingAdapter(name: string, adapter: EmbeddingAdapter): void;
|
|
1830
|
+
/**
|
|
1831
|
+
* Registers a rerank adapter under a name that a query gives in
|
|
1832
|
+
* `rerank.adapter`. Registering a name again sends every later query that
|
|
1833
|
+
* gives that name to the new adapter. The engine throws
|
|
1834
|
+
* `RERANK_CONFIG_INVALID` for an empty name and for an adapter without a
|
|
1984
1835
|
* `rerank` function.
|
|
1836
|
+
*
|
|
1837
|
+
* @param name - The name that a query gives in `rerank.adapter`.
|
|
1838
|
+
* @param adapter - The adapter that scores the top hits of a query.
|
|
1985
1839
|
*/
|
|
1986
|
-
|
|
1840
|
+
registerRerankAdapter(name: string, adapter: RerankAdapter): void;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* The analysis settings that {@link AnalysisOperations.changeAnalysis} changes
|
|
1845
|
+
* on a live index. A key that you leave out keeps its current value.
|
|
1846
|
+
*
|
|
1847
|
+
* @public
|
|
1848
|
+
*/
|
|
1849
|
+
interface AnalysisChange {
|
|
1850
|
+
/** This is the name of a registered language. */
|
|
1851
|
+
language?: string;
|
|
1987
1852
|
/**
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1853
|
+
* This is a name that {@link registerTokenizer} bound. Pass `null` to return
|
|
1854
|
+
* to the tokeniser of the language.
|
|
1855
|
+
*/
|
|
1856
|
+
tokenizer?: string | null;
|
|
1857
|
+
/**
|
|
1858
|
+
* This is a name that {@link registerStopWords} bound, or a list of words.
|
|
1859
|
+
* Pass `null` to return to the stop words of the language.
|
|
1993
1860
|
*/
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
*
|
|
2010
|
-
*
|
|
2011
|
-
*
|
|
2012
|
-
*
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
*
|
|
2019
|
-
*
|
|
2020
|
-
*
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
*
|
|
2024
|
-
*
|
|
2025
|
-
*
|
|
2026
|
-
*
|
|
2027
|
-
*
|
|
2028
|
-
*
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
* cap, the engine throws `SEARCH_WORK_CAP_EXCEEDED`. The cap
|
|
2032
|
-
* defaults to 25,000,000 units. For any value other than a whole number from
|
|
2033
|
-
* 1 to `Number.MAX_SAFE_INTEGER`, {@link createNarsil} throws
|
|
2034
|
-
* `CONFIG_INVALID`.
|
|
2035
|
-
*/
|
|
2036
|
-
patternWorkCap?: number;
|
|
2037
|
-
/**
|
|
2038
|
-
* These fractions set the memory levels at which the engine stops and resumes
|
|
2039
|
-
* accepting inserts and updates, so that a write cannot take the process past
|
|
2040
|
-
* its memory limit. Inside a cluster node, the node's own memory settings
|
|
2041
|
-
* apply in place of these. For a fraction outside the range that
|
|
2042
|
-
* {@link MemoryConfig} describes, {@link createNarsil} throws `CONFIG_INVALID`
|
|
2043
|
-
* on Node.js and on a phone. A browser reports no memory limit, so the
|
|
2044
|
-
* engine there ignores this setting and leaves it unchecked.
|
|
2045
|
-
*/
|
|
2046
|
-
memory?: MemoryConfig;
|
|
1861
|
+
stopWords?: string | readonly string[] | ReadonlySet<string> | null;
|
|
1862
|
+
}
|
|
1863
|
+
/**
|
|
1864
|
+
* Changes how an index turns text into terms while the index keeps answering
|
|
1865
|
+
* searches.
|
|
1866
|
+
*
|
|
1867
|
+
* @public
|
|
1868
|
+
*/
|
|
1869
|
+
interface AnalysisOperations {
|
|
1870
|
+
/**
|
|
1871
|
+
* Gives you an index that matches text under new settings, while the index
|
|
1872
|
+
* keeps answering searches and accepting writes.
|
|
1873
|
+
*
|
|
1874
|
+
* The engine builds the new terms beside the old ones. Searches keep matching
|
|
1875
|
+
* under the old settings during that time, while every write that the engine
|
|
1876
|
+
* accepts reaches the new terms. Each search matches under one set of
|
|
1877
|
+
* settings, either the old or the new, and the rebuild leaves vectors alone.
|
|
1878
|
+
* The promise resolves once a durable checkpoint holds the new terms, or once
|
|
1879
|
+
* the switch happens on an engine without durability. After a restart at any
|
|
1880
|
+
* point, the engine goes on to finish the change.
|
|
1881
|
+
*
|
|
1882
|
+
* @param indexName - The index to change.
|
|
1883
|
+
* @param change - The settings to change. A change to the values that the
|
|
1884
|
+
* index already holds completes with no rebuild.
|
|
1885
|
+
* @throws A `NarsilError` with `LANGUAGE_NOT_SUPPORTED` for an unregistered
|
|
1886
|
+
* language, with `CONFIG_INVALID` for an unregistered name, a tokeniser
|
|
1887
|
+
* instance, a stop word function, or a synonym word that breaks the synonym
|
|
1888
|
+
* rules under the new settings, with `ANALYSIS_REBUILD_MEMORY_EXCEEDED` when a
|
|
1889
|
+
* second copy of the terms does not fit in memory, with
|
|
1890
|
+
* `ANALYSIS_CHANGE_REPLACED` when a later change or a restore replaces this
|
|
1891
|
+
* one or when a restore of the index is in flight, with
|
|
1892
|
+
* `ANALYSIS_CHANGE_NOT_READY` when the previous change has no durable
|
|
1893
|
+
* checkpoint yet, with `PERSISTENCE_SAVE_FAILED` when the new terms
|
|
1894
|
+
* answer searches before a durable checkpoint holds them, and with
|
|
1895
|
+
* `PARTITION_REBALANCING_BACKPRESSURE` during a rebalance.
|
|
1896
|
+
*/
|
|
1897
|
+
changeAnalysis(indexName: string, change: AnalysisChange): Promise<void>;
|
|
2047
1898
|
}
|
|
1899
|
+
|
|
2048
1900
|
/**
|
|
2049
|
-
*
|
|
2050
|
-
*
|
|
1901
|
+
* Changes the BM25 setting of a live index, which
|
|
1902
|
+
* {@link IndexConfig.bm25} sets when the index is created.
|
|
2051
1903
|
*
|
|
2052
|
-
*
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
1904
|
+
* @public
|
|
1905
|
+
*/
|
|
1906
|
+
interface BM25Operations {
|
|
1907
|
+
/**
|
|
1908
|
+
* Replaces the BM25 setting of an index, so that every search that starts
|
|
1909
|
+
* after the promise resolves scores under the new setting.
|
|
1910
|
+
*
|
|
1911
|
+
* The call replaces the whole setting, so a value that it leaves out returns
|
|
1912
|
+
* to its default, and `{}` clears the setting. The engine rebuilds nothing,
|
|
1913
|
+
* because the setting changes no stored token. It saves the setting with the
|
|
1914
|
+
* index, so the setting stays in place after a restart, and every snapshot
|
|
1915
|
+
* of the index includes it. Where the index has copies on worker threads,
|
|
1916
|
+
* the promise resolves only once every copy holds the new setting. A cursor
|
|
1917
|
+
* from before the change keeps working, and its next pages can repeat or
|
|
1918
|
+
* skip documents, because the scores that order them can change.
|
|
1919
|
+
*
|
|
1920
|
+
* @param indexName - The index whose setting the engine replaces.
|
|
1921
|
+
* @param bm25 - The new setting, in the shape that {@link BM25Params} describes.
|
|
1922
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` when `k1` is not a number from
|
|
1923
|
+
* 0 to 1,000, when `b` is not a number from 0 to 1, or when `fields` holds a
|
|
1924
|
+
* name that is not a text field. The index then keeps the setting that it
|
|
1925
|
+
* held before the call.
|
|
1926
|
+
*/
|
|
1927
|
+
updateBM25(indexName: string, bm25: BM25Params): Promise<void>;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* The bytes that {@link Narsil.restore} and {@link Narsil.importDocumentExport}
|
|
1932
|
+
* accept, as one array, a stream of chunks, or an async iterable of chunks,
|
|
1933
|
+
* such as a Node.js file stream.
|
|
1934
|
+
*
|
|
1935
|
+
* @public
|
|
1936
|
+
*/
|
|
1937
|
+
type ByteSource = Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* Opens and closes durable indexes without deleting them.
|
|
2065
1941
|
*
|
|
2066
1942
|
* @public
|
|
2067
1943
|
*/
|
|
2068
|
-
interface
|
|
1944
|
+
interface IndexLifecycleOperations {
|
|
2069
1945
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
*
|
|
2072
|
-
*
|
|
2073
|
-
*
|
|
2074
|
-
* full collections in a row that each leave the old generation holding at
|
|
2075
|
-
* least 0.8 of its limit.
|
|
1946
|
+
* Loads a closed index from its durable checkpoint and resets a parked recovery failure.
|
|
1947
|
+
*
|
|
1948
|
+
* @param indexName - The index to load.
|
|
1949
|
+
* @returns A promise that settles when the index is ready for operations.
|
|
2076
1950
|
*/
|
|
2077
|
-
|
|
1951
|
+
open(indexName: string): Promise<void>;
|
|
2078
1952
|
/**
|
|
2079
|
-
*
|
|
2080
|
-
*
|
|
2081
|
-
*
|
|
2082
|
-
*
|
|
2083
|
-
* same reason that it caps the heap side of `blockWritesAbove` at 0.75.
|
|
1953
|
+
* Drains active work, checkpoints the index, releases its memory, and keeps its durable files.
|
|
1954
|
+
*
|
|
1955
|
+
* @param indexName - The index to close.
|
|
1956
|
+
* @returns A promise that settles after the index releases its memory.
|
|
2084
1957
|
*/
|
|
2085
|
-
|
|
1958
|
+
close(indexName: string): Promise<void>;
|
|
2086
1959
|
}
|
|
1960
|
+
|
|
2087
1961
|
/**
|
|
2088
|
-
*
|
|
1962
|
+
* The device sync setting of one index, which {@link SyncOperations.updateSync} takes.
|
|
1963
|
+
*
|
|
1964
|
+
* Turn sync on only for an index whose every document belongs to one user, because every device that syncs the index
|
|
1965
|
+
* receives the whole index. Create one index for each user, and leave sync off for a public index or for an index that
|
|
1966
|
+
* holds the data of several users.
|
|
2089
1967
|
*
|
|
2090
1968
|
* @public
|
|
2091
1969
|
*/
|
|
2092
|
-
interface
|
|
2093
|
-
/**
|
|
2094
|
-
|
|
2095
|
-
/**
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
1970
|
+
interface SyncSetting {
|
|
1971
|
+
/** This turns sync on or off. Turning it on gives the index a new epoch, so every synced device loads a new copy. */
|
|
1972
|
+
enabled: boolean;
|
|
1973
|
+
/** This is the age in milliseconds after which the server deletes a log segment from history. It defaults to 30
|
|
1974
|
+
* days. */
|
|
1975
|
+
historyMaxAgeMs?: number;
|
|
1976
|
+
/** This is the byte count above which the server deletes the oldest log segment from history. It defaults to the
|
|
1977
|
+
* length of the published snapshot. */
|
|
1978
|
+
historyMaxBytes?: number;
|
|
2101
1979
|
}
|
|
2102
1980
|
/**
|
|
2103
|
-
*
|
|
2104
|
-
* one its language module carries today.
|
|
1981
|
+
* The device sync state of one index, which {@link SyncOperations.getSync} returns.
|
|
2105
1982
|
*
|
|
2106
|
-
*
|
|
2107
|
-
|
|
1983
|
+
* @public
|
|
1984
|
+
*/
|
|
1985
|
+
interface SyncStatus extends SyncSetting {
|
|
1986
|
+
/** This is true once a device has asked for the published snapshot, from when the server keeps history. */
|
|
1987
|
+
active: boolean;
|
|
1988
|
+
/** This is the index epoch, 32 lowercase hexadecimal digits, or `null` while sync is off. */
|
|
1989
|
+
epoch: string | null;
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* The methods that turn device sync on and off for an index.
|
|
2108
1993
|
*
|
|
2109
1994
|
* @public
|
|
2110
1995
|
*/
|
|
2111
|
-
interface
|
|
2112
|
-
/**
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
1996
|
+
interface SyncOperations {
|
|
1997
|
+
/**
|
|
1998
|
+
* Replaces the device sync setting of an index.
|
|
1999
|
+
*
|
|
2000
|
+
* Turning sync on gives the index a new epoch. Changing a history limit while sync is on keeps the epoch. Turning
|
|
2001
|
+
* sync off deletes the published snapshot and the history, and the server closes every feed of the index with
|
|
2002
|
+
* close code 4410. The engine saves the setting with the index, so the setting stays in place after a restart, and
|
|
2003
|
+
* no snapshot of the index includes it.
|
|
2004
|
+
*
|
|
2005
|
+
* @param indexName - The index whose setting the engine replaces.
|
|
2006
|
+
* @param setting - The new setting.
|
|
2007
|
+
* @throws A `NarsilError` with `SYNC_DURABILITY_REQUIRED` when the engine has no write-ahead log durability, and
|
|
2008
|
+
* with `CONFIG_INVALID` when a history limit is not a positive whole number.
|
|
2009
|
+
*/
|
|
2010
|
+
updateSync(indexName: string, setting: SyncSetting): Promise<void>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Returns the device sync state of an index.
|
|
2013
|
+
*
|
|
2014
|
+
* @param indexName - The index whose state the engine returns.
|
|
2015
|
+
* @returns The setting, whether a device has asked for the snapshot, and the epoch.
|
|
2016
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
|
|
2017
|
+
*/
|
|
2018
|
+
getSync(indexName: string): Promise<SyncStatus>;
|
|
2122
2019
|
}
|
|
2020
|
+
|
|
2123
2021
|
/**
|
|
2124
|
-
*
|
|
2125
|
-
*
|
|
2022
|
+
* Reads and replaces the synonym set of an index, which
|
|
2023
|
+
* {@link IndexConfig.synonyms} sets when the index is created.
|
|
2126
2024
|
*
|
|
2127
|
-
*
|
|
2128
|
-
|
|
2129
|
-
|
|
2025
|
+
* @public
|
|
2026
|
+
*/
|
|
2027
|
+
interface SynonymOperations {
|
|
2028
|
+
/**
|
|
2029
|
+
* Replaces the synonym set of an index, so that every search that starts
|
|
2030
|
+
* after the promise resolves expands its words with the new set.
|
|
2031
|
+
*
|
|
2032
|
+
* The engine applies the set without rebuilding the index, because a
|
|
2033
|
+
* synonym set changes no stored token. It saves the set with the index, so
|
|
2034
|
+
* the set stays in place after a restart, and every snapshot of the index
|
|
2035
|
+
* includes it. Where the index has copies on worker threads, the promise
|
|
2036
|
+
* resolves only once every copy uses the new set. Pass an empty list to
|
|
2037
|
+
* remove the set.
|
|
2038
|
+
*
|
|
2039
|
+
* @param indexName - The index whose set the engine replaces.
|
|
2040
|
+
* @param synonyms - The new set, in the shape that {@link SynonymRule}
|
|
2041
|
+
* describes.
|
|
2042
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
|
|
2043
|
+
* shape, when a word analyses to no token or to more than one, or when the
|
|
2044
|
+
* set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
|
|
2045
|
+
* UTF-8. The index then keeps the set that it held before the call.
|
|
2046
|
+
*/
|
|
2047
|
+
updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
|
|
2048
|
+
/**
|
|
2049
|
+
* Returns the synonym set of an index with every word as the caller wrote
|
|
2050
|
+
* it, or an empty list when the index holds no set.
|
|
2051
|
+
*
|
|
2052
|
+
* @param indexName - The index whose set the engine returns.
|
|
2053
|
+
*/
|
|
2054
|
+
getSynonyms(indexName: string): Promise<SynonymRule[]>;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* Reports on and rebuilds the graphs of an index's vector fields.
|
|
2130
2059
|
*
|
|
2131
2060
|
* @public
|
|
2132
2061
|
*/
|
|
2133
|
-
interface
|
|
2134
|
-
/**
|
|
2135
|
-
|
|
2062
|
+
interface VectorMaintenanceOperations {
|
|
2063
|
+
/**
|
|
2064
|
+
* Rebuilds a vector field's graph without the tombstones removed documents
|
|
2065
|
+
* left behind, which returns the memory they held and speeds searches up.
|
|
2066
|
+
*
|
|
2067
|
+
* Read {@link VectorMaintenanceOperations.vectorMaintenanceStatus} first to
|
|
2068
|
+
* see whether the work is worth its cost.
|
|
2069
|
+
*
|
|
2070
|
+
* @param indexName - The index holding the field.
|
|
2071
|
+
* @param fieldName - The vector field to compact. Omit it to compact every
|
|
2072
|
+
* vector field in the index.
|
|
2073
|
+
*/
|
|
2074
|
+
compactVectors(indexName: string, fieldName?: string): Promise<void>;
|
|
2075
|
+
/**
|
|
2076
|
+
* Rebuilds a vector field's graph from scratch, which recovers the recall a
|
|
2077
|
+
* long run of inserts and removals costs.
|
|
2078
|
+
*
|
|
2079
|
+
* This is heavier than {@link VectorMaintenanceOperations.compactVectors} and
|
|
2080
|
+
* gives a better graph, so run it once a search starts missing documents it
|
|
2081
|
+
* should find, rather than on a schedule.
|
|
2082
|
+
*
|
|
2083
|
+
* @param indexName - The index holding the field.
|
|
2084
|
+
* @param fieldName - The vector field to rebuild. Omit it to rebuild every
|
|
2085
|
+
* vector field in the index.
|
|
2086
|
+
*/
|
|
2087
|
+
optimizeVectors(indexName: string, fieldName?: string): Promise<void>;
|
|
2136
2088
|
/**
|
|
2137
|
-
*
|
|
2089
|
+
* Reports the state of each vector field in an index, and what compaction or
|
|
2090
|
+
* optimisation would cost.
|
|
2138
2091
|
*
|
|
2139
|
-
* @param
|
|
2140
|
-
* @
|
|
2141
|
-
* carries current terms. Under `manual` nothing rebuilds until you call it.
|
|
2092
|
+
* @param indexName - The index to describe.
|
|
2093
|
+
* @returns One entry per vector field, or an empty list while the index is closed.
|
|
2142
2094
|
*/
|
|
2143
|
-
|
|
2095
|
+
vectorMaintenanceStatus(indexName: string): VectorMaintenanceResult[];
|
|
2144
2096
|
}
|
|
2097
|
+
|
|
2145
2098
|
/**
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2149
|
-
*
|
|
2150
|
-
*
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2153
|
-
*
|
|
2154
|
-
* @public
|
|
2155
|
-
*/
|
|
2156
|
-
interface
|
|
2157
|
-
/**
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
*
|
|
2173
|
-
*
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2099
|
+
* Adds, replaces, and removes documents, and waits for the worker copies to
|
|
2100
|
+
* catch up with those writes.
|
|
2101
|
+
*
|
|
2102
|
+
* A write returns once the main copy holds it, and the worker copies apply
|
|
2103
|
+
* it afterwards, so a query that a copy answers can come back without a write
|
|
2104
|
+
* that returned before it. Every write takes a `wait` option for the cases
|
|
2105
|
+
* where the next query has to see it.
|
|
2106
|
+
*
|
|
2107
|
+
* @public
|
|
2108
|
+
*/
|
|
2109
|
+
interface DocumentWriteOperations {
|
|
2110
|
+
/**
|
|
2111
|
+
* Adds one document to an index and returns the id it is stored under.
|
|
2112
|
+
*
|
|
2113
|
+
* The id comes from the `docId` argument when you pass one, otherwise from
|
|
2114
|
+
* the document's own `id` field, and otherwise the engine generates it. Use
|
|
2115
|
+
* {@link DocumentWriteOperations.insertBatch} for a large load, so that one
|
|
2116
|
+
* bad document cannot abandon the rest.
|
|
2117
|
+
*
|
|
2118
|
+
* @param indexName - The index that receives the document.
|
|
2119
|
+
* @param document - Its fields must match the types the schema declares.
|
|
2120
|
+
* @param docId - Pass an id to control it yourself, or omit it and read the
|
|
2121
|
+
* returned value. An id that differs from the document's own `id` field
|
|
2122
|
+
* raises `DOC_VALIDATION_FAILED`, because the stored document would
|
|
2123
|
+
* otherwise contradict the key that it is stored under.
|
|
2124
|
+
* @param options - Per-write settings, such as skipping the defensive copy
|
|
2125
|
+
* or waiting for every worker copy to apply the write.
|
|
2126
|
+
* @returns The id the document is stored under.
|
|
2127
|
+
*/
|
|
2128
|
+
insert(indexName: string, document: AnyDocument, docId?: string, options?: InsertOptions): Promise<string>;
|
|
2129
|
+
/**
|
|
2130
|
+
* Adds many documents in one pass and reports each one's outcome.
|
|
2131
|
+
*
|
|
2132
|
+
* A document the engine rejects appears in `failed` with the error that
|
|
2133
|
+
* rejected it, and every other document is still written, which is what
|
|
2134
|
+
* makes this the call to load a corpus with.
|
|
2135
|
+
*
|
|
2136
|
+
* @param indexName - The index that receives the documents.
|
|
2137
|
+
* @param documents - The documents to write, each carrying its own id or
|
|
2138
|
+
* leaving the engine to generate one.
|
|
2139
|
+
* @param options - Per-write settings applied to every document.
|
|
2140
|
+
* @returns The ids written, and each rejection with its error.
|
|
2141
|
+
*/
|
|
2142
|
+
insertBatch(indexName: string, documents: AnyDocument[], options?: InsertOptions): Promise<BatchResult>;
|
|
2143
|
+
/**
|
|
2144
|
+
* Removes one document.
|
|
2145
|
+
*
|
|
2146
|
+
* @param indexName - The index holding the document.
|
|
2147
|
+
* @param docId - The document to remove.
|
|
2148
|
+
* @param options - Per-write settings, such as waiting for every worker
|
|
2149
|
+
* copy to apply the removal.
|
|
2150
|
+
* @throws A `NarsilError` with `DOC_NOT_FOUND` when the index holds no such
|
|
2151
|
+
* document.
|
|
2152
|
+
*/
|
|
2153
|
+
remove(indexName: string, docId: string, options?: WriteOptions): Promise<void>;
|
|
2154
|
+
/**
|
|
2155
|
+
* Removes many documents in one pass and reports each one's outcome.
|
|
2156
|
+
*
|
|
2157
|
+
* @param indexName - The index holding the documents.
|
|
2158
|
+
* @param docIds - The documents to remove.
|
|
2159
|
+
* @param options - Per-write settings applied to the whole batch.
|
|
2160
|
+
* @returns The ids removed, and each failure with its error.
|
|
2161
|
+
*/
|
|
2162
|
+
removeBatch(indexName: string, docIds: string[], options?: WriteOptions): Promise<BatchResult>;
|
|
2163
|
+
/**
|
|
2164
|
+
* Replaces a stored document with the one you pass.
|
|
2165
|
+
*
|
|
2166
|
+
* The engine removes the old document and indexes the new one, so the
|
|
2167
|
+
* document you supply has to be complete, with every field it should hold
|
|
2168
|
+
* afterwards.
|
|
2169
|
+
*
|
|
2170
|
+
* @param indexName - The index holding the document.
|
|
2171
|
+
* @param docId - The document to replace.
|
|
2172
|
+
* @param document - The complete replacement.
|
|
2173
|
+
* @param options - Per-write settings, such as waiting for every worker
|
|
2174
|
+
* copy to apply the replacement.
|
|
2175
|
+
*/
|
|
2176
|
+
update(indexName: string, docId: string, document: AnyDocument, options?: WriteOptions): Promise<void>;
|
|
2177
|
+
/**
|
|
2178
|
+
* Replaces many documents in one pass and reports each one's outcome.
|
|
2179
|
+
*
|
|
2180
|
+
* @param indexName - The index holding the documents.
|
|
2181
|
+
* @param updates - Each id with the complete document that replaces it.
|
|
2182
|
+
* @param options - Per-write settings applied to the whole batch.
|
|
2183
|
+
* @returns The ids replaced, and each failure with its error.
|
|
2184
|
+
*/
|
|
2185
|
+
updateBatch(indexName: string, updates: Array<{
|
|
2186
|
+
docId: string;
|
|
2187
|
+
document: AnyDocument;
|
|
2188
|
+
}>, options?: WriteOptions): Promise<BatchResult>;
|
|
2189
|
+
/**
|
|
2190
|
+
* Resolves once every worker copy of an index has applied every write that
|
|
2191
|
+
* returned before the call.
|
|
2192
|
+
*
|
|
2193
|
+
* Call this after a run of writes, or pass `wait: true` on one write,
|
|
2194
|
+
* before a query that has to see them. An index that holds no copies
|
|
2195
|
+
* resolves at once.
|
|
2196
|
+
*
|
|
2197
|
+
* @param indexName - The index whose copies have to catch up.
|
|
2198
|
+
*/
|
|
2199
|
+
waitForWrites(indexName: string): Promise<void>;
|
|
2177
2200
|
}
|
|
2201
|
+
|
|
2178
2202
|
/**
|
|
2179
|
-
*
|
|
2180
|
-
* copies. Under `lone`, the main copy answers a query the engine receives
|
|
2181
|
-
* while no copy holds one, on an index of at most 50,000 documents. Once
|
|
2182
|
-
* every copy is busy, it also answers one query per turn of the event loop.
|
|
2183
|
-
* Under `none`, every query on an index that holds copies goes to one of
|
|
2184
|
-
* them, while the main copy still answers a query on an index whose copies
|
|
2185
|
-
* are loading.
|
|
2203
|
+
* What {@link Narsil.snapshot} adds to the archive beyond the checkpoint.
|
|
2186
2204
|
*
|
|
2187
2205
|
* @public
|
|
2188
2206
|
*/
|
|
2189
|
-
|
|
2207
|
+
interface SnapshotOptions {
|
|
2208
|
+
/**
|
|
2209
|
+
* Set this to add the index's popular query history, which holds raw
|
|
2210
|
+
* searches, so that a restore on a node with the same key keeps the counts.
|
|
2211
|
+
* Defaults to false, because a backup that holds history can keep searches
|
|
2212
|
+
* past their retention.
|
|
2213
|
+
*/
|
|
2214
|
+
queryHistory?: boolean;
|
|
2215
|
+
}
|
|
2190
2216
|
/**
|
|
2191
|
-
*
|
|
2192
|
-
* they may use.
|
|
2217
|
+
* The search engine, and everything you do with it.
|
|
2193
2218
|
*
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
2196
|
-
*
|
|
2197
|
-
*
|
|
2219
|
+
* One instance holds every index you create, so an application usually keeps a
|
|
2220
|
+
* single engine for its lifetime and reaches each index by name. Build one
|
|
2221
|
+
* with {@link createNarsil}. Its write, open and close, synonym, analysis, BM25,
|
|
2222
|
+
* device sync, vector maintenance, and adapter registration methods come from
|
|
2223
|
+
* {@link DocumentWriteOperations}, {@link IndexLifecycleOperations},
|
|
2224
|
+
* {@link SynonymOperations}, {@link AnalysisOperations},
|
|
2225
|
+
* {@link BM25Operations}, {@link SyncOperations},
|
|
2226
|
+
* {@link VectorMaintenanceOperations}, and
|
|
2227
|
+
* {@link AdapterRegistrationOperations}.
|
|
2198
2228
|
*
|
|
2199
2229
|
* @public
|
|
2200
2230
|
*/
|
|
2201
|
-
interface
|
|
2231
|
+
interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AnalysisOperations, BM25Operations, SyncOperations, VectorMaintenanceOperations, AdapterRegistrationOperations {
|
|
2232
|
+
/**
|
|
2233
|
+
* Creates an index you can insert documents into and query.
|
|
2234
|
+
*
|
|
2235
|
+
* The schema sets the type of each field, marks which fields you can
|
|
2236
|
+
* filter and sort on, and controls how the engine tokenises text. The
|
|
2237
|
+
* `language` option picks the analyser that stems those text fields.
|
|
2238
|
+
*
|
|
2239
|
+
* @param name - Every later call uses this name to reach the index.
|
|
2240
|
+
* @param config - This carries the schema, and the language, partitioning,
|
|
2241
|
+
* and scoring settings.
|
|
2242
|
+
*/
|
|
2243
|
+
createIndex(name: string, config: IndexConfig): Promise<void>;
|
|
2244
|
+
/**
|
|
2245
|
+
* Removes an index and everything it holds, including whatever persistence
|
|
2246
|
+
* wrote for it. The documents do not come back.
|
|
2247
|
+
*
|
|
2248
|
+
* @param name - The index to drop.
|
|
2249
|
+
*/
|
|
2250
|
+
dropIndex(name: string): Promise<void>;
|
|
2202
2251
|
/**
|
|
2203
|
-
*
|
|
2204
|
-
*
|
|
2205
|
-
*
|
|
2206
|
-
* `@delali/narsil` into an application bundle, the engine finds no worker
|
|
2207
|
-
* entry: left unset, it answers on one thread and prints one warning, and
|
|
2208
|
-
* set to true, `createNarsil` throws `CONFIG_INVALID`.
|
|
2252
|
+
* Lists every index this engine holds, with its size and its language.
|
|
2253
|
+
*
|
|
2254
|
+
* @returns One entry per index, in creation order.
|
|
2209
2255
|
*/
|
|
2210
|
-
|
|
2256
|
+
listIndexes(): IndexInfo[];
|
|
2211
2257
|
/**
|
|
2212
|
-
*
|
|
2213
|
-
*
|
|
2214
|
-
*
|
|
2215
|
-
*
|
|
2216
|
-
*
|
|
2217
|
-
*
|
|
2218
|
-
* reserves.
|
|
2258
|
+
* Returns one index's document count, partition count, memory estimate,
|
|
2259
|
+
* language, and schema.
|
|
2260
|
+
*
|
|
2261
|
+
* @param indexName - The index to describe.
|
|
2262
|
+
* @returns The index's current figures.
|
|
2263
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` for an unknown name.
|
|
2219
2264
|
*/
|
|
2220
|
-
|
|
2221
|
-
/** An index gains worker copies once it holds this many documents, 1,000 by default. */
|
|
2222
|
-
promotionThreshold?: number;
|
|
2265
|
+
getStats(indexName: string): IndexStats;
|
|
2223
2266
|
/**
|
|
2224
|
-
*
|
|
2225
|
-
*
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2228
|
-
*
|
|
2267
|
+
* Returns per-partition figures for one index, which is where you look when
|
|
2268
|
+
* an index grows unevenly or a rebalance is worth running.
|
|
2269
|
+
*
|
|
2270
|
+
* @param indexName - The index to describe.
|
|
2271
|
+
* @returns One entry per open partition, in partition order, or an empty list while the index is closed.
|
|
2229
2272
|
*/
|
|
2230
|
-
|
|
2273
|
+
getPartitionStats(indexName: string): PartitionStatsResult[];
|
|
2231
2274
|
/**
|
|
2232
|
-
*
|
|
2233
|
-
*
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
*
|
|
2275
|
+
* Fetches one stored document by id, without searching.
|
|
2276
|
+
*
|
|
2277
|
+
* A vector field comes back as a `Float32Array`, whatever form you give it.
|
|
2278
|
+
* `JSON.stringify` writes one as an object keyed by index, so convert it
|
|
2279
|
+
* with `Array.from`, or project the field away, before you serialise the
|
|
2280
|
+
* document yourself. The HTTP routes convert it for you.
|
|
2281
|
+
*
|
|
2282
|
+
* @param indexName - The index holding the document.
|
|
2283
|
+
* @param docId - The document to fetch.
|
|
2284
|
+
* @returns The document, or `undefined` when the index holds no such id.
|
|
2285
|
+
*/
|
|
2286
|
+
get(indexName: string, docId: string): Promise<AnyDocument | undefined>;
|
|
2287
|
+
/**
|
|
2288
|
+
* Fetches many stored documents by id in one pass.
|
|
2289
|
+
*
|
|
2290
|
+
* @param indexName - The index holding the documents.
|
|
2291
|
+
* @param docIds - The documents to fetch.
|
|
2292
|
+
* @returns A map from id to document, holding an entry for each id that
|
|
2293
|
+
* exists and nothing for the rest.
|
|
2294
|
+
*/
|
|
2295
|
+
getMultiple(indexName: string, docIds: string[]): Promise<Map<string, AnyDocument>>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Reports whether an index holds a document, without reading it.
|
|
2298
|
+
*
|
|
2299
|
+
* @param indexName - The index to check.
|
|
2300
|
+
* @param docId - The document to look for.
|
|
2301
|
+
* @returns True when the index holds that id.
|
|
2237
2302
|
*/
|
|
2238
|
-
|
|
2303
|
+
has(indexName: string, docId: string): Promise<boolean>;
|
|
2239
2304
|
/**
|
|
2240
|
-
*
|
|
2241
|
-
*
|
|
2242
|
-
*
|
|
2243
|
-
*
|
|
2244
|
-
|
|
2305
|
+
* Counts the documents an index holds.
|
|
2306
|
+
*
|
|
2307
|
+
* @param indexName - The index to count.
|
|
2308
|
+
* @returns The document count across every partition.
|
|
2309
|
+
*/
|
|
2310
|
+
countDocuments(indexName: string): Promise<number>;
|
|
2311
|
+
/**
|
|
2312
|
+
* Reads one page of stored documents in document-id order, without
|
|
2313
|
+
* searching, which is how you page through a whole index.
|
|
2314
|
+
*
|
|
2315
|
+
* Leave `cursor` out for the first page, pass the returned cursor back for
|
|
2316
|
+
* each page after it, and stop when the cursor comes back null. A document
|
|
2317
|
+
* that stays in the index for the whole listing comes back exactly once. The
|
|
2318
|
+
* engine skips a document you remove part-way through. It returns one you
|
|
2319
|
+
* insert part-way through once that document's id sorts above the cursor.
|
|
2320
|
+
* The cursor holds no engine state, so it stays valid after a restart, a
|
|
2321
|
+
* snapshot restore, and a rebalance.
|
|
2322
|
+
*
|
|
2323
|
+
* The engine compares document ids by their UTF-16 code units, so `"10"`
|
|
2324
|
+
* sorts ahead of `"9"`.
|
|
2325
|
+
*
|
|
2326
|
+
* Set `document` to drop a vector field, because the engine otherwise reads
|
|
2327
|
+
* every listed document's vector back out of the index.
|
|
2328
|
+
*
|
|
2329
|
+
* @typeParam T - Shape of the stored documents, which flows through to each
|
|
2330
|
+
* entry's `document`.
|
|
2331
|
+
* @param indexName - The index to walk.
|
|
2332
|
+
* @param params - These set the cursor, the page size, the filter, and how
|
|
2333
|
+
* much of each document comes back.
|
|
2334
|
+
* @returns The page, the cursor for the next page, how many documents the
|
|
2335
|
+
* listing walks in total, and the time the page took.
|
|
2336
|
+
*/
|
|
2337
|
+
listDocuments<T = AnyDocument>(indexName: string, params?: ListParams): Promise<ListResult<T>>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Runs a search against an index and returns the ranked hits.
|
|
2340
|
+
*
|
|
2341
|
+
* One call covers keyword search, vector search, and a hybrid of the two,
|
|
2342
|
+
* chosen by the `mode` parameter. BM25 ranks keyword results by default.
|
|
2343
|
+
* Every hit carries its score and its document, along with highlights when
|
|
2344
|
+
* you ask for them.
|
|
2345
|
+
*
|
|
2346
|
+
* @typeParam T - Shape of the stored documents, which flows through to each
|
|
2347
|
+
* hit's `document`.
|
|
2348
|
+
* @param indexName - The index the search runs against.
|
|
2349
|
+
* @param params - These set the search term, filters, field boosts, sorting,
|
|
2350
|
+
* facets, highlighting, and the result limit.
|
|
2351
|
+
* @returns The hits, the total count, the elapsed time, and any facets or
|
|
2352
|
+
* groups the query asked for.
|
|
2353
|
+
*/
|
|
2354
|
+
query<T = AnyDocument>(indexName: string, params: QueryParams): Promise<QueryResult<T>>;
|
|
2355
|
+
/**
|
|
2356
|
+
* Counts what a query would match without building a single hit, which is
|
|
2357
|
+
* how a result-count badge stays cheap. A full-text count also skips scoring
|
|
2358
|
+
* unless the query carries `minScore`, which prunes matches by score, or a
|
|
2359
|
+
* `termMatch` policy other than `any`, which prunes them by term coverage. A
|
|
2360
|
+
* vector or hybrid count still runs its search.
|
|
2361
|
+
*
|
|
2362
|
+
* @param indexName - The index the query would run against.
|
|
2363
|
+
* @param params - The same parameters {@link Narsil.query} takes. Anything
|
|
2364
|
+
* that shapes the output alone, such as `limit` or `highlight`, is ignored.
|
|
2365
|
+
* @returns The match count and the time the count took.
|
|
2366
|
+
*/
|
|
2367
|
+
preflight(indexName: string, params: QueryParams): Promise<PreflightResult>;
|
|
2368
|
+
/**
|
|
2369
|
+
* Returns the indexed terms that complete a prefix, ready to offer as
|
|
2370
|
+
* you-type suggestions.
|
|
2371
|
+
*
|
|
2372
|
+
* The terms come back as the index holds them, which means stems unless the
|
|
2373
|
+
* index was created with `surfaceForms`.
|
|
2374
|
+
*
|
|
2375
|
+
* @param indexName - The index to draw completions from.
|
|
2376
|
+
* @param params - The prefix typed so far, and how many completions to
|
|
2377
|
+
* return.
|
|
2378
|
+
* @returns The completions, most widely used first.
|
|
2379
|
+
*/
|
|
2380
|
+
suggest(indexName: string, params: SuggestParams): Promise<SuggestResult>;
|
|
2381
|
+
/**
|
|
2382
|
+
* Rebuilds an index's terms from the documents it already stores, and
|
|
2383
|
+
* resolves once every partition carries terms the current language module
|
|
2384
|
+
* produced.
|
|
2385
|
+
*
|
|
2386
|
+
* An index whose stored analysis revision differs from the one its language
|
|
2387
|
+
* module carries answers text queries from terms an earlier analysis wrote,
|
|
2388
|
+
* and every such result reports `analysisStale`. Call this after the engine
|
|
2389
|
+
* reports a stale index to configuration that declined an automatic rebuild.
|
|
2390
|
+
* Calling it for an index whose terms are current does nothing.
|
|
2391
|
+
*
|
|
2392
|
+
* @param indexName - The index whose terms are rebuilt.
|
|
2393
|
+
*/
|
|
2394
|
+
rebuildAnalysis(indexName: string): Promise<void>;
|
|
2395
|
+
/**
|
|
2396
|
+
* Returns a stream of the index's snapshot archive. The archive is a pax
|
|
2397
|
+
* file containing the index's configuration and the files of one
|
|
2398
|
+
* checkpoint, and any implementation of the Narsil format can restore it.
|
|
2399
|
+
*
|
|
2400
|
+
* With write-ahead log durability, the engine takes a checkpoint before it
|
|
2401
|
+
* starts the stream, so the archive contains every write that the engine
|
|
2402
|
+
* acknowledged before the call. The engine keeps that checkpoint's files on
|
|
2403
|
+
* disk until the stream ends or you cancel it. Without write-ahead log
|
|
2404
|
+
* durability, the engine builds the archive's files from the index in
|
|
2405
|
+
* memory.
|
|
2406
|
+
*
|
|
2407
|
+
* @param indexName - The index to stream.
|
|
2408
|
+
* @param options - Set `queryHistory` to add the index's popular query
|
|
2409
|
+
* history, which holds raw searches, after the checkpoint's files.
|
|
2410
|
+
* @returns A stream of the archive's bytes, which you can write to a file or
|
|
2411
|
+
* send over a network.
|
|
2412
|
+
*/
|
|
2413
|
+
snapshot(indexName: string, options?: SnapshotOptions): Promise<ReadableStream<Uint8Array>>;
|
|
2414
|
+
/**
|
|
2415
|
+
* Creates an index from a snapshot under the name that you pass, replacing
|
|
2416
|
+
* any index of that name.
|
|
2417
|
+
*
|
|
2418
|
+
* The engine accepts the archive that {@link Narsil.snapshot} streams and
|
|
2419
|
+
* the `.nrsl` file of release 0.3. It checks each archive file against its
|
|
2420
|
+
* manifest and loads the restored index beside the existing one, which
|
|
2421
|
+
* answers requests until the swap. A failed restore leaves the existing index
|
|
2422
|
+
* serving, and after a crash the engine reopens either the old or the new one.
|
|
2423
|
+
*
|
|
2424
|
+
* @param indexName - The name that the restored index takes.
|
|
2425
|
+
* @param data - The snapshot's bytes, as an array, a stream, or async chunks.
|
|
2426
|
+
* @throws A `NarsilError` with `PERSISTENCE_LOAD_FAILED` when the archive is
|
|
2427
|
+
* malformed or a file's length differs from the manifest. The engine raises
|
|
2428
|
+
* `PERSISTENCE_CRC_MISMATCH` when a file's checksum differs from its
|
|
2429
|
+
* contents, and `ENVELOPE_VERSION_MISMATCH` when a file has a format version
|
|
2430
|
+
* other than the ones that this release implements. It raises
|
|
2431
|
+
* `CONFIG_INVALID` when the archive's configuration is invalid,
|
|
2432
|
+
* `DOC_VALIDATION_FAILED` when the data is empty or the release 0.3 file is
|
|
2433
|
+
* invalid, `RESTORE_MEMORY_EXCEEDED` when the restored index needs more
|
|
2434
|
+
* memory than the process has free, and `WORKER_TIMEOUT` when a
|
|
2435
|
+
* worker still holds the old index 30 seconds after the engine asks for it.
|
|
2436
|
+
*/
|
|
2437
|
+
restore(indexName: string, data: ByteSource): Promise<void>;
|
|
2438
|
+
/**
|
|
2439
|
+
* Returns a stream of the index's document export. The export is JSON Lines
|
|
2440
|
+
* text whose format stays the same in every release, so you can use it to
|
|
2441
|
+
* move an index across releases or between implementations.
|
|
2442
|
+
*
|
|
2443
|
+
* The first line is a header containing the format name, the format
|
|
2444
|
+
* version, and the index configuration. Each later line contains one
|
|
2445
|
+
* document, with its ID under `id` and the value of each vector field as an
|
|
2446
|
+
* array of numbers. With write-ahead log durability, the engine exports every
|
|
2447
|
+
* document from one checkpoint; otherwise, it exports them from the index in
|
|
2448
|
+
* memory at one moment.
|
|
2449
|
+
*
|
|
2450
|
+
* JSON has no type for a date, for raw bytes, or for an infinite number or
|
|
2451
|
+
* `NaN`, so the engine writes each such value as a tag. Each tag is an
|
|
2452
|
+
* object with one key that begins with `$`, such as
|
|
2453
|
+
* `{"$date":[1700000000,123000000]}`. The engine also wraps a stored object
|
|
2454
|
+
* whose only key begins with `$` in an `$object` tag, because the import
|
|
2455
|
+
* decodes every other object of that shape as a tag.
|
|
2456
|
+
*
|
|
2457
|
+
* @param indexName - The index to export.
|
|
2458
|
+
* @returns A stream of the export's UTF-8 bytes.
|
|
2459
|
+
*/
|
|
2460
|
+
exportDocuments(indexName: string): Promise<ReadableStream<Uint8Array>>;
|
|
2461
|
+
/**
|
|
2462
|
+
* Imports a document export into the named index. Where the name is free,
|
|
2463
|
+
* the engine creates the index from the export's configuration.
|
|
2464
|
+
*
|
|
2465
|
+
* The engine writes the documents in batches and replaces any document
|
|
2466
|
+
* whose ID the index already contains. Because it replaces existing
|
|
2467
|
+
* documents, you can run an interrupted import again to make the index equal
|
|
2468
|
+
* to the export. When a line is invalid or the engine rejects its document,
|
|
2469
|
+
* the engine records the refusal and continues with the next line.
|
|
2470
|
+
*
|
|
2471
|
+
* The engine converts each tag that {@link Narsil.exportDocuments} writes
|
|
2472
|
+
* into the value that the tag stands for. When an object has one key that
|
|
2473
|
+
* begins with `$` and that key names no tag, or when a tag holds an invalid
|
|
2474
|
+
* value, the engine refuses the line.
|
|
2475
|
+
*
|
|
2476
|
+
* @param indexName - The index that receives the documents.
|
|
2477
|
+
* @param data - The export's bytes, as one array, a stream, or an async
|
|
2478
|
+
* iterable of chunks.
|
|
2479
|
+
* @returns The number of imported documents, the number of refused lines,
|
|
2480
|
+
* and the 1,000 refusals with the lowest line numbers.
|
|
2481
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` when the first line is
|
|
2482
|
+
* anything other than a version 1 header, or when the named index exists
|
|
2483
|
+
* with a different schema.
|
|
2484
|
+
*/
|
|
2485
|
+
importDocumentExport(indexName: string, data: ByteSource): Promise<DocumentImportResult>;
|
|
2486
|
+
/**
|
|
2487
|
+
* Writes an index's current state to the durability directory, so a restart
|
|
2488
|
+
* replays less of the log.
|
|
2489
|
+
*
|
|
2490
|
+
* @param indexName - The index to checkpoint.
|
|
2491
|
+
*/
|
|
2492
|
+
checkpoint(indexName: string): Promise<void>;
|
|
2493
|
+
/**
|
|
2494
|
+
* Removes every document from an index and keeps the index itself, along
|
|
2495
|
+
* with its schema and settings.
|
|
2496
|
+
*
|
|
2497
|
+
* @param indexName - The index to empty.
|
|
2498
|
+
*/
|
|
2499
|
+
clear(indexName: string): Promise<void>;
|
|
2500
|
+
/**
|
|
2501
|
+
* Spreads an index's documents across a different number of partitions.
|
|
2502
|
+
*
|
|
2503
|
+
* The engine keeps answering queries throughout, and it queues the writes
|
|
2504
|
+
* that arrive while the work runs, replaying them in order once it finishes.
|
|
2505
|
+
*
|
|
2506
|
+
* @param indexName - The index to rebalance.
|
|
2507
|
+
* @param targetPartitionCount - Partitions the index ends up with.
|
|
2508
|
+
*/
|
|
2509
|
+
rebalance(indexName: string, targetPartitionCount: number): Promise<void>;
|
|
2510
|
+
/**
|
|
2511
|
+
* Changes how an index grows into new partitions, without moving the
|
|
2512
|
+
* documents it already holds.
|
|
2513
|
+
*
|
|
2514
|
+
* @param indexName - The index to reconfigure.
|
|
2515
|
+
* @param config - The partitioning fields to change. Anything you leave out
|
|
2516
|
+
* keeps its current value.
|
|
2517
|
+
*/
|
|
2518
|
+
updatePartitionConfig(indexName: string, config: Partial<PartitionConfig>): Promise<void>;
|
|
2519
|
+
/**
|
|
2520
|
+
* Reports what this engine and its host process are using, which is what you
|
|
2521
|
+
* size a host from.
|
|
2522
|
+
*
|
|
2523
|
+
* @returns Process heap figures, the engine's own estimate, and one entry
|
|
2524
|
+
* per worker once the engine has promoted.
|
|
2525
|
+
*/
|
|
2526
|
+
getMemoryStats(): Promise<MemoryStats>;
|
|
2527
|
+
/**
|
|
2528
|
+
* Starts delivering one kind of engine event to your listener.
|
|
2529
|
+
*
|
|
2530
|
+
* These events report work the engine does on its own, away from the call
|
|
2531
|
+
* that triggered it, so this is where a failed background save or a worker
|
|
2532
|
+
* crash reaches you.
|
|
2533
|
+
*
|
|
2534
|
+
* @typeParam K - The event name, which fixes the payload the listener gets.
|
|
2535
|
+
* @param event - Which event to listen for.
|
|
2536
|
+
* @param handler - Called once per event.
|
|
2537
|
+
*/
|
|
2538
|
+
on<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
|
|
2539
|
+
/**
|
|
2540
|
+
* Removes a listener {@link Narsil.on} registered, so it receives no
|
|
2541
|
+
* further events.
|
|
2542
|
+
*
|
|
2543
|
+
* @typeParam K - The event name.
|
|
2544
|
+
* @param event - The event the listener was registered for.
|
|
2545
|
+
* @param handler - The same function reference that was registered.
|
|
2546
|
+
*/
|
|
2547
|
+
off<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
|
|
2548
|
+
/**
|
|
2549
|
+
* Closes the engine: it flushes pending writes, ends its workers, and
|
|
2550
|
+
* releases every adapter it opened.
|
|
2551
|
+
*
|
|
2552
|
+
* Call it before the process exits, because writes still in flight are lost
|
|
2553
|
+
* otherwise. The engine rejects new work once this starts.
|
|
2245
2554
|
*/
|
|
2246
|
-
|
|
2555
|
+
shutdown(): Promise<void>;
|
|
2247
2556
|
}
|
|
2248
2557
|
|
|
2249
|
-
export { type
|
|
2558
|
+
export { type IndexLifecycleOperations as $, type AnalysisChange as A, type BatchResult as B, type ClientErrorCode as C, type DocumentImportResult as D, type ErrorCode as E, type FacetConfig as F, type GroupResult as G, type FacetResult as H, type IndexInfo as I, type FieldFilter as J, type FilterExpression as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type GeoFilter as O, type PartitionStatsResult as P, type QueryParams as Q, type GeoPolygonFilter as R, type ServerErrorCode as S, type GeoRadiusFilter as T, type GroupReducer as U, type VectorMaintenanceResult as V, type HeldCheckpointReport as W, type HighlightConfig as X, type HighlightMatch as Y, type Hit as Z, type HybridConfig as _, ClientErrorCodes as a, type ListedDocument as a0, type PresenceFilter as a1, type ProcessMemoryReport as a2, type QueryCoverage as a3, type RerankConfig as a4, type ScoreComponents as a5, type SearchMode as a6, type SortField as a7, type SortSpec as a8, type StringFilter as a9, type SyncOperations as aa, type SynonymOperations as ab, type TermMatchPolicy as ac, type VectorMaintenanceOperations as ad, type VectorQueryConfig as ae, type WorkerCopyReport as af, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type SnapshotOptions as e, type SyncSetting as f, type Narsil as g, type QueryResult as h, isNarsilError as i, type NarsilEventHandlers as j, type SyncStatus as k, type ListResult as l, type SuggestParams as m, type SuggestResult as n, type PreflightResult as o, type IndexStats as p, type NarsilEventMap as q, type GroupConfig as r, type AdapterRegistrationOperations as s, type AnalysisOperations as t, type ArrayFilter as u, type BM25Operations as v, type ByteSource as w, type ComparisonFilter as x, type DocumentProjection as y, type DocumentWriteOperations as z };
|