feat: introduce fuzzy search for native indexer (#14109)

This commit is contained in:
DarkSky
2025-12-25 04:40:23 +08:00
committed by GitHub
parent b6dc68eddf
commit e8693a3a25
24 changed files with 237 additions and 537 deletions
Generated
+31 -10
View File
@@ -49,7 +49,7 @@ dependencies = [
"assert-json-diff",
"cc",
"chrono",
"criterion2",
"criterion",
"docx-parser",
"infer",
"path-ext",
@@ -61,6 +61,7 @@ dependencies = [
"serde_json",
"sha3",
"strum_macros",
"tempfile",
"text-splitter",
"thiserror 2.0.12",
"tiktoken-rs",
@@ -153,16 +154,14 @@ dependencies = [
"bincode",
"chrono",
"dotenvy",
"jieba-rs",
"memory-indexer",
"napi",
"napi-build",
"napi-derive",
"once_cell",
"serde",
"serde_json",
"sqlx",
"thiserror 2.0.12",
"tiniestsegmenter",
"tokio",
"uniffi",
"uuid",
@@ -2642,6 +2641,22 @@ version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "memory-indexer"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10feba381e2eeb6582f34379d62ee0658e57f63d776698150b985bd0f38664b3"
dependencies = [
"jieba-rs",
"once_cell",
"pinyin",
"serde",
"serde_json",
"strsim",
"unicode-normalization",
"unicode-script",
]
[[package]]
name = "mimalloc"
version = "0.1.46"
@@ -3284,6 +3299,12 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pinyin"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16f2611cd06a1ac239a0cea4521de9eb068a6ca110324ee00631aa68daa74fc0"
[[package]]
name = "pkcs1"
version = "0.7.5"
@@ -4772,12 +4793,6 @@ dependencies = [
"rustc-hash 1.1.0",
]
[[package]]
name = "tiniestsegmenter"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f39721481fb54f0e9f3a1da5a6ac6063c61ec62ec828cd5e1860acce9458f40"
[[package]]
name = "tinystr"
version = "0.8.1"
@@ -5141,6 +5156,12 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0"
[[package]]
name = "unicode-script"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee"
[[package]]
name = "unicode-segmentation"
version = "1.12.0"