├── .cargo
└── config
├── .editorconfig
├── .envrc
├── .github
└── workflows
│ ├── luarocks.yml
│ ├── release-please.yml
│ └── template.rockspec
├── .gitignore
├── CHANGELOG.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── flake.lock
├── flake.nix
├── lua
├── neorg
│ └── modules
│ │ └── external
│ │ └── search
│ │ └── module.lua
└── neorg_se
│ └── init.lua
├── neorg-se-scm-1.rockspec
├── src
├── lib.rs
├── main.rs.bak
└── search_engine.rs
└── stylua.toml
/.cargo/config:
--------------------------------------------------------------------------------
1 | [target.x86_64-apple-darwin]
2 | rustflags = [
3 | "-C", "link-arg=-undefined",
4 | "-C", "link-arg=dynamic_lookup",
5 | ]
6 |
7 | [target.aarch64-apple-darwin]
8 | rustflags = [
9 | "-C", "link-arg=-undefined",
10 | "-C", "link-arg=dynamic_lookup",
11 | "-C", "default-linker-libraries",
12 | ]
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | indent_style = space
3 | indent_size = 4
4 |
--------------------------------------------------------------------------------
/.envrc:
--------------------------------------------------------------------------------
1 | use_flake
2 |
--------------------------------------------------------------------------------
/.github/workflows/luarocks.yml:
--------------------------------------------------------------------------------
1 | name: Push to Luarocks
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 | release:
8 | types:
9 | - created
10 | pull_request: # Test luarocks install without publishing on PR
11 | workflow_dispatch:
12 |
13 | jobs:
14 | luarocks-upload:
15 | runs-on: ubuntu-22.04
16 | steps:
17 | - uses: actions/checkout@v4
18 | with:
19 | fetch-depth: 0 # Required to count the commits
20 | - name: Get Version
21 | run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
22 | - name: LuaRocks Upload
23 | uses: nvim-neorocks/luarocks-tag-release@v6
24 | env:
25 | LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
26 | with:
27 | version: ${{ env.LUAROCKS_VERSION }}
28 | template: "./.github/workflows/template.rockspec"
29 | dependencies: |
30 | neorg >= 8
31 | telescope.nvim
32 | lua ~> 5.1
33 |
--------------------------------------------------------------------------------
/.github/workflows/release-please.yml:
--------------------------------------------------------------------------------
1 | ---
2 | permissions:
3 | contents: write
4 | pull-requests: write
5 |
6 | name: Release Please
7 |
8 | on:
9 | workflow_dispatch:
10 | push:
11 | branches:
12 | - main
13 |
14 | jobs:
15 | release:
16 | name: release
17 | runs-on: ubuntu-latest
18 | steps:
19 | - uses: google-github-actions/release-please-action@v4
20 | with:
21 | release-type: simple
22 | token: ${{ secrets.PAT }}
23 |
--------------------------------------------------------------------------------
/.github/workflows/template.rockspec:
--------------------------------------------------------------------------------
1 | local git_ref = '$git_ref'
2 | local modrev = '$modrev'
3 | local specrev = '$specrev'
4 |
5 | local repo_url = '$repo_url'
6 |
7 | rockspec_format = '3.0'
8 | package = '$package'
9 | version = modrev ..'-'.. specrev
10 |
11 | description = {
12 | summary = '$summary',
13 | detailed = $detailed_description,
14 | labels = $labels,
15 | homepage = '$homepage',
16 | $license
17 | }
18 |
19 | dependencies = $dependencies
20 |
21 | build_dependencies = {
22 | 'luarocks-build-rust-mlua',
23 | }
24 |
25 | test_dependencies = $test_dependencies
26 |
27 | source = {
28 | url = repo_url .. '/archive/' .. git_ref .. '.zip',
29 | dir = '$repo_name-' .. '$archive_dir_suffix',
30 | }
31 |
32 | if modrev == 'scm' or modrev == 'dev' then
33 | source = {
34 | url = repo_url:gsub('https', 'git')
35 | }
36 | end
37 |
38 | build = {
39 | type = "rust-mlua",
40 |
41 | modules = {
42 | ["libneorg_se"] = "neorg_se",
43 | },
44 |
45 | install = {
46 | lua = {
47 | ["neorg_se.init"] = "lua/neorg_se/init.lua",
48 | ["neorg.modules.external.search.module"] = "lua/neorg/modules/external/search/module.lua",
49 | },
50 | },
51 |
52 | copy_directories = $copy_directories,
53 | }
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .luarc.json
2 | .direnv/
3 | neorg-SE.log
4 |
5 | # Compiled Lua sources
6 | luac.out
7 |
8 | # luarocks build files
9 | *.src.rock
10 | *.zip
11 | *.tar.gz
12 |
13 | # Object files
14 | *.o
15 | *.os
16 | *.ko
17 | *.obj
18 | *.elf
19 |
20 | # Precompiled Headers
21 | *.gch
22 | *.pch
23 |
24 | # Libraries
25 | *.lib
26 | *.a
27 | *.la
28 | *.lo
29 | *.def
30 | *.exp
31 |
32 | # Shared objects (inc. Windows DLLs)
33 | *.dll
34 | *.so
35 | *.so.*
36 | *.dylib
37 |
38 | # Executables
39 | *.exe
40 | *.out
41 | *.app
42 | *.i*86
43 | *.x86_64
44 | *.hex
45 |
46 |
47 |
48 | # Added by cargo
49 |
50 | /target
51 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## [1.1.10](https://github.com/benlubas/neorg-se/compare/v1.1.9...v1.1.10) (2024-07-27)
4 |
5 |
6 | ### Bug Fixes
7 |
8 | * **build:** specify build dependencies ([c86f1d4](https://github.com/benlubas/neorg-se/commit/c86f1d4360ee8fcc5f76ada1849ee3291b2ba9c2))
9 | * **build:** specify build dependencies in template ([f7c4284](https://github.com/benlubas/neorg-se/commit/f7c4284be2d75c10c3b465332908929ba3e0061b))
10 | * **flake:** load libiconv-darwin only on darwin systems ([0a2d361](https://github.com/benlubas/neorg-se/commit/0a2d361afe624c1881ba2a65a755dc2e46394de9))
11 | * use build_dependencies for build backend ([e38f17b](https://github.com/benlubas/neorg-se/commit/e38f17b6053c9833b62cd080014b4d0174cf3a84))
12 |
13 | ## [1.1.9](https://github.com/benlubas/neorg-se/compare/v1.1.8...v1.1.9) (2024-07-17)
14 |
15 |
16 | ### Bug Fixes
17 |
18 | * location of installed lua file ([85fa327](https://github.com/benlubas/neorg-se/commit/85fa327f5afd0cdeaae61b768b18346594cd152c))
19 |
20 | ## [1.1.8](https://github.com/benlubas/neorg-se/compare/v1.1.7...v1.1.8) (2024-07-17)
21 |
22 |
23 | ### Bug Fixes
24 |
25 | * add build to generated rockspec ([b2025e1](https://github.com/benlubas/neorg-se/commit/b2025e16b1d422bad9fda85a31dea800289173a2))
26 |
27 | ## [1.1.7](https://github.com/benlubas/neorg-se/compare/v1.1.6...v1.1.7) (2024-07-16)
28 |
29 |
30 | ### Bug Fixes
31 |
32 | * attempt to install lua/ as well ([91d26d9](https://github.com/benlubas/neorg-se/commit/91d26d93ec16efd79f5a48748513c516cc1cef6b))
33 |
34 | ## [1.1.6](https://github.com/benlubas/neorg-se/compare/v1.1.5...v1.1.6) (2024-07-16)
35 |
36 |
37 | ### Bug Fixes
38 |
39 | * missing , ([7948c78](https://github.com/benlubas/neorg-se/commit/7948c78c3642ea9b2b36c6c273ef0ed8aa36a49f))
40 | * path relative to repo root? ([eef730b](https://github.com/benlubas/neorg-se/commit/eef730b5d9cf87e72f0d2aa28ba310ab6c21058f))
41 | * use a custom rockspec template ([a13611a](https://github.com/benlubas/neorg-se/commit/a13611a7af78a6a49dbed0a7d6a952b86e3d3e9a))
42 |
43 | ## [1.1.5](https://github.com/benlubas/neorg-se/compare/v1.1.4...v1.1.5) (2024-07-16)
44 |
45 |
46 | ### Bug Fixes
47 |
48 | * add telescope as a dep ([f9837b1](https://github.com/benlubas/neorg-se/commit/f9837b151340a6efe2221c1cab96ba96e348babe))
49 |
50 | ## [1.1.4](https://github.com/benlubas/neorg-se/compare/v1.1.3...v1.1.4) (2024-07-16)
51 |
52 |
53 | ### Bug Fixes
54 |
55 | * create module (actually this time) ([bf03fff](https://github.com/benlubas/neorg-se/commit/bf03ffff7288bdf297b02dc1745af8fd894cb6ef))
56 |
57 | ## [1.1.3](https://github.com/benlubas/neorg-se/compare/v1.1.2...v1.1.3) (2024-07-16)
58 |
59 |
60 | ### Bug Fixes
61 |
62 | * create module ([12b4002](https://github.com/benlubas/neorg-se/commit/12b40025321cbc2aaa6825548bed8d38c37b3904))
63 |
64 | ## [1.1.2](https://github.com/benlubas/neorg-se/compare/v1.1.1...v1.1.2) (2024-07-16)
65 |
66 |
67 | ### Bug Fixes
68 |
69 | * trigger CI ([0d11c59](https://github.com/benlubas/neorg-se/commit/0d11c59e01441dd1fa74c3fb8ac695840cfc2e4a))
70 |
71 | ## [1.1.1](https://github.com/benlubas/neorg-se/compare/v1.1.0...v1.1.1) (2024-07-16)
72 |
73 |
74 | ### Bug Fixes
75 |
76 | * try copy lua files when installing rock ([b018ea4](https://github.com/benlubas/neorg-se/commit/b018ea4be046bd5eb7dda10050fa4b89c8d76604))
77 |
78 | ## [1.1.0](https://github.com/benlubas/neorg-se/compare/v1.0.1...v1.1.0) (2024-07-16)
79 |
80 |
81 | ### Features
82 |
83 | * luajit feature flag ([9467986](https://github.com/benlubas/neorg-se/commit/9467986666731f10cce764a29cf15ffc1eb5016d))
84 |
85 | ## [1.0.1](https://github.com/benlubas/neorg-se/compare/v1.0.0...v1.0.1) (2024-07-15)
86 |
87 |
88 | ### Bug Fixes
89 |
90 | * readme (this is just to trigger release please) ([b9deadd](https://github.com/benlubas/neorg-se/commit/b9deadd0b4a9410d4be7300beb720ff2fa32bed2))
91 |
92 | ## 1.0.0 (2024-07-15)
93 |
94 |
95 | ### Features
96 |
97 | * category completions via neorg-interim-ls ([642247d](https://github.com/benlubas/neorg-se/commit/642247d59165af3138c14384b494f8aac5454326))
98 | * category search ([7e3174b](https://github.com/benlubas/neorg-se/commit/7e3174b877fa7db6b1d557348d4632503380540f))
99 | * luarocks CI ([e5e5691](https://github.com/benlubas/neorg-se/commit/e5e5691b16435dc4ab9162d9009266d0a40745ca))
100 | * use mlua instead of RPC ([6121c09](https://github.com/benlubas/neorg-se/commit/6121c09b48133a90f17e29f7a61f9177967dd50b))
101 |
--------------------------------------------------------------------------------
/Cargo.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Cargo.
2 | # It is not intended for manual editing.
3 | version = 3
4 |
5 | [[package]]
6 | name = "ahash"
7 | version = "0.8.11"
8 | source = "registry+https://github.com/rust-lang/crates.io-index"
9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
10 | dependencies = [
11 | "cfg-if 1.0.0",
12 | "once_cell",
13 | "version_check",
14 | "zerocopy",
15 | ]
16 |
17 | [[package]]
18 | name = "aho-corasick"
19 | version = "1.1.3"
20 | source = "registry+https://github.com/rust-lang/crates.io-index"
21 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
22 | dependencies = [
23 | "memchr",
24 | ]
25 |
26 | [[package]]
27 | name = "allocator-api2"
28 | version = "0.2.18"
29 | source = "registry+https://github.com/rust-lang/crates.io-index"
30 | checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
31 |
32 | [[package]]
33 | name = "anstream"
34 | version = "0.6.14"
35 | source = "registry+https://github.com/rust-lang/crates.io-index"
36 | checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
37 | dependencies = [
38 | "anstyle",
39 | "anstyle-parse",
40 | "anstyle-query",
41 | "anstyle-wincon",
42 | "colorchoice",
43 | "is_terminal_polyfill",
44 | "utf8parse",
45 | ]
46 |
47 | [[package]]
48 | name = "anstyle"
49 | version = "1.0.7"
50 | source = "registry+https://github.com/rust-lang/crates.io-index"
51 | checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
52 |
53 | [[package]]
54 | name = "anstyle-parse"
55 | version = "0.2.4"
56 | source = "registry+https://github.com/rust-lang/crates.io-index"
57 | checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
58 | dependencies = [
59 | "utf8parse",
60 | ]
61 |
62 | [[package]]
63 | name = "anstyle-query"
64 | version = "1.1.0"
65 | source = "registry+https://github.com/rust-lang/crates.io-index"
66 | checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
67 | dependencies = [
68 | "windows-sys 0.52.0",
69 | ]
70 |
71 | [[package]]
72 | name = "anstyle-wincon"
73 | version = "3.0.3"
74 | source = "registry+https://github.com/rust-lang/crates.io-index"
75 | checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
76 | dependencies = [
77 | "anstyle",
78 | "windows-sys 0.52.0",
79 | ]
80 |
81 | [[package]]
82 | name = "anyhow"
83 | version = "1.0.86"
84 | source = "registry+https://github.com/rust-lang/crates.io-index"
85 | checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
86 |
87 | [[package]]
88 | name = "arc-swap"
89 | version = "1.7.1"
90 | source = "registry+https://github.com/rust-lang/crates.io-index"
91 | checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
92 |
93 | [[package]]
94 | name = "async-trait"
95 | version = "0.1.81"
96 | source = "registry+https://github.com/rust-lang/crates.io-index"
97 | checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
98 | dependencies = [
99 | "proc-macro2",
100 | "quote",
101 | "syn",
102 | ]
103 |
104 | [[package]]
105 | name = "autocfg"
106 | version = "1.3.0"
107 | source = "registry+https://github.com/rust-lang/crates.io-index"
108 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
109 |
110 | [[package]]
111 | name = "base64"
112 | version = "0.22.1"
113 | source = "registry+https://github.com/rust-lang/crates.io-index"
114 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
115 |
116 | [[package]]
117 | name = "bitflags"
118 | version = "2.6.0"
119 | source = "registry+https://github.com/rust-lang/crates.io-index"
120 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
121 |
122 | [[package]]
123 | name = "bitpacking"
124 | version = "0.9.2"
125 | source = "registry+https://github.com/rust-lang/crates.io-index"
126 | checksum = "4c1d3e2bfd8d06048a179f7b17afc3188effa10385e7b00dc65af6aae732ea92"
127 | dependencies = [
128 | "crunchy",
129 | ]
130 |
131 | [[package]]
132 | name = "bstr"
133 | version = "1.9.1"
134 | source = "registry+https://github.com/rust-lang/crates.io-index"
135 | checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706"
136 | dependencies = [
137 | "memchr",
138 | "serde",
139 | ]
140 |
141 | [[package]]
142 | name = "bumpalo"
143 | version = "3.16.0"
144 | source = "registry+https://github.com/rust-lang/crates.io-index"
145 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
146 |
147 | [[package]]
148 | name = "byteorder"
149 | version = "1.5.0"
150 | source = "registry+https://github.com/rust-lang/crates.io-index"
151 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
152 |
153 | [[package]]
154 | name = "cc"
155 | version = "1.1.1"
156 | source = "registry+https://github.com/rust-lang/crates.io-index"
157 | checksum = "907d8581360765417f8f2e0e7d602733bbed60156b4465b7617243689ef9b83d"
158 | dependencies = [
159 | "jobserver",
160 | "libc",
161 | "once_cell",
162 | ]
163 |
164 | [[package]]
165 | name = "census"
166 | version = "0.4.2"
167 | source = "registry+https://github.com/rust-lang/crates.io-index"
168 | checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0"
169 |
170 | [[package]]
171 | name = "cfg-if"
172 | version = "0.1.10"
173 | source = "registry+https://github.com/rust-lang/crates.io-index"
174 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
175 |
176 | [[package]]
177 | name = "cfg-if"
178 | version = "1.0.0"
179 | source = "registry+https://github.com/rust-lang/crates.io-index"
180 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
181 |
182 | [[package]]
183 | name = "colog"
184 | version = "1.3.0"
185 | source = "registry+https://github.com/rust-lang/crates.io-index"
186 | checksum = "2c426b7af8d5e0ad79de6713996632ce31f0d68ba84068fb0d654b396e519df0"
187 | dependencies = [
188 | "colored",
189 | "env_logger",
190 | "log",
191 | ]
192 |
193 | [[package]]
194 | name = "colorchoice"
195 | version = "1.0.1"
196 | source = "registry+https://github.com/rust-lang/crates.io-index"
197 | checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
198 |
199 | [[package]]
200 | name = "colored"
201 | version = "2.1.0"
202 | source = "registry+https://github.com/rust-lang/crates.io-index"
203 | checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8"
204 | dependencies = [
205 | "lazy_static",
206 | "windows-sys 0.48.0",
207 | ]
208 |
209 | [[package]]
210 | name = "crc32fast"
211 | version = "1.4.2"
212 | source = "registry+https://github.com/rust-lang/crates.io-index"
213 | checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
214 | dependencies = [
215 | "cfg-if 1.0.0",
216 | ]
217 |
218 | [[package]]
219 | name = "crossbeam-channel"
220 | version = "0.5.13"
221 | source = "registry+https://github.com/rust-lang/crates.io-index"
222 | checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
223 | dependencies = [
224 | "crossbeam-utils",
225 | ]
226 |
227 | [[package]]
228 | name = "crossbeam-deque"
229 | version = "0.8.5"
230 | source = "registry+https://github.com/rust-lang/crates.io-index"
231 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
232 | dependencies = [
233 | "crossbeam-epoch",
234 | "crossbeam-utils",
235 | ]
236 |
237 | [[package]]
238 | name = "crossbeam-epoch"
239 | version = "0.9.18"
240 | source = "registry+https://github.com/rust-lang/crates.io-index"
241 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
242 | dependencies = [
243 | "crossbeam-utils",
244 | ]
245 |
246 | [[package]]
247 | name = "crossbeam-utils"
248 | version = "0.8.20"
249 | source = "registry+https://github.com/rust-lang/crates.io-index"
250 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
251 |
252 | [[package]]
253 | name = "crunchy"
254 | version = "0.2.2"
255 | source = "registry+https://github.com/rust-lang/crates.io-index"
256 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
257 |
258 | [[package]]
259 | name = "deranged"
260 | version = "0.3.11"
261 | source = "registry+https://github.com/rust-lang/crates.io-index"
262 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
263 | dependencies = [
264 | "powerfmt",
265 | "serde",
266 | ]
267 |
268 | [[package]]
269 | name = "dirs"
270 | version = "5.0.1"
271 | source = "registry+https://github.com/rust-lang/crates.io-index"
272 | checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"
273 | dependencies = [
274 | "dirs-sys",
275 | ]
276 |
277 | [[package]]
278 | name = "dirs-sys"
279 | version = "0.4.1"
280 | source = "registry+https://github.com/rust-lang/crates.io-index"
281 | checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
282 | dependencies = [
283 | "libc",
284 | "option-ext",
285 | "redox_users",
286 | "windows-sys 0.48.0",
287 | ]
288 |
289 | [[package]]
290 | name = "downcast-rs"
291 | version = "1.2.1"
292 | source = "registry+https://github.com/rust-lang/crates.io-index"
293 | checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
294 |
295 | [[package]]
296 | name = "either"
297 | version = "1.13.0"
298 | source = "registry+https://github.com/rust-lang/crates.io-index"
299 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
300 |
301 | [[package]]
302 | name = "env_filter"
303 | version = "0.1.0"
304 | source = "registry+https://github.com/rust-lang/crates.io-index"
305 | checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea"
306 | dependencies = [
307 | "log",
308 | "regex",
309 | ]
310 |
311 | [[package]]
312 | name = "env_logger"
313 | version = "0.11.3"
314 | source = "registry+https://github.com/rust-lang/crates.io-index"
315 | checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9"
316 | dependencies = [
317 | "anstream",
318 | "anstyle",
319 | "env_filter",
320 | "humantime",
321 | "log",
322 | ]
323 |
324 | [[package]]
325 | name = "errno"
326 | version = "0.3.9"
327 | source = "registry+https://github.com/rust-lang/crates.io-index"
328 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
329 | dependencies = [
330 | "libc",
331 | "windows-sys 0.52.0",
332 | ]
333 |
334 | [[package]]
335 | name = "fastdivide"
336 | version = "0.4.1"
337 | source = "registry+https://github.com/rust-lang/crates.io-index"
338 | checksum = "59668941c55e5c186b8b58c391629af56774ec768f73c08bbcd56f09348eb00b"
339 |
340 | [[package]]
341 | name = "fastrand"
342 | version = "2.1.0"
343 | source = "registry+https://github.com/rust-lang/crates.io-index"
344 | checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
345 |
346 | [[package]]
347 | name = "fnv"
348 | version = "1.0.7"
349 | source = "registry+https://github.com/rust-lang/crates.io-index"
350 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
351 |
352 | [[package]]
353 | name = "fs4"
354 | version = "0.8.4"
355 | source = "registry+https://github.com/rust-lang/crates.io-index"
356 | checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8"
357 | dependencies = [
358 | "rustix",
359 | "windows-sys 0.52.0",
360 | ]
361 |
362 | [[package]]
363 | name = "getrandom"
364 | version = "0.2.15"
365 | source = "registry+https://github.com/rust-lang/crates.io-index"
366 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
367 | dependencies = [
368 | "cfg-if 1.0.0",
369 | "libc",
370 | "wasi",
371 | ]
372 |
373 | [[package]]
374 | name = "globset"
375 | version = "0.4.14"
376 | source = "registry+https://github.com/rust-lang/crates.io-index"
377 | checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1"
378 | dependencies = [
379 | "aho-corasick",
380 | "bstr",
381 | "log",
382 | "regex-automata",
383 | "regex-syntax",
384 | ]
385 |
386 | [[package]]
387 | name = "hashbrown"
388 | version = "0.14.5"
389 | source = "registry+https://github.com/rust-lang/crates.io-index"
390 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
391 | dependencies = [
392 | "ahash",
393 | "allocator-api2",
394 | ]
395 |
396 | [[package]]
397 | name = "hermit-abi"
398 | version = "0.3.9"
399 | source = "registry+https://github.com/rust-lang/crates.io-index"
400 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
401 |
402 | [[package]]
403 | name = "htmlescape"
404 | version = "0.3.1"
405 | source = "registry+https://github.com/rust-lang/crates.io-index"
406 | checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163"
407 |
408 | [[package]]
409 | name = "humantime"
410 | version = "2.1.0"
411 | source = "registry+https://github.com/rust-lang/crates.io-index"
412 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
413 |
414 | [[package]]
415 | name = "ignore"
416 | version = "0.4.22"
417 | source = "registry+https://github.com/rust-lang/crates.io-index"
418 | checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1"
419 | dependencies = [
420 | "crossbeam-deque",
421 | "globset",
422 | "log",
423 | "memchr",
424 | "regex-automata",
425 | "same-file",
426 | "walkdir",
427 | "winapi-util",
428 | ]
429 |
430 | [[package]]
431 | name = "instant"
432 | version = "0.1.13"
433 | source = "registry+https://github.com/rust-lang/crates.io-index"
434 | checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
435 | dependencies = [
436 | "cfg-if 1.0.0",
437 | "js-sys",
438 | "wasm-bindgen",
439 | "web-sys",
440 | ]
441 |
442 | [[package]]
443 | name = "is_terminal_polyfill"
444 | version = "1.70.0"
445 | source = "registry+https://github.com/rust-lang/crates.io-index"
446 | checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
447 |
448 | [[package]]
449 | name = "itertools"
450 | version = "0.12.1"
451 | source = "registry+https://github.com/rust-lang/crates.io-index"
452 | checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
453 | dependencies = [
454 | "either",
455 | ]
456 |
457 | [[package]]
458 | name = "itoa"
459 | version = "1.0.11"
460 | source = "registry+https://github.com/rust-lang/crates.io-index"
461 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
462 |
463 | [[package]]
464 | name = "jobserver"
465 | version = "0.1.31"
466 | source = "registry+https://github.com/rust-lang/crates.io-index"
467 | checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e"
468 | dependencies = [
469 | "libc",
470 | ]
471 |
472 | [[package]]
473 | name = "js-sys"
474 | version = "0.3.69"
475 | source = "registry+https://github.com/rust-lang/crates.io-index"
476 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
477 | dependencies = [
478 | "wasm-bindgen",
479 | ]
480 |
481 | [[package]]
482 | name = "lazy_static"
483 | version = "1.5.0"
484 | source = "registry+https://github.com/rust-lang/crates.io-index"
485 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
486 |
487 | [[package]]
488 | name = "levenshtein_automata"
489 | version = "0.2.1"
490 | source = "registry+https://github.com/rust-lang/crates.io-index"
491 | checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25"
492 |
493 | [[package]]
494 | name = "libc"
495 | version = "0.2.155"
496 | source = "registry+https://github.com/rust-lang/crates.io-index"
497 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
498 |
499 | [[package]]
500 | name = "libm"
501 | version = "0.2.8"
502 | source = "registry+https://github.com/rust-lang/crates.io-index"
503 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
504 |
505 | [[package]]
506 | name = "libredox"
507 | version = "0.1.3"
508 | source = "registry+https://github.com/rust-lang/crates.io-index"
509 | checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
510 | dependencies = [
511 | "bitflags",
512 | "libc",
513 | ]
514 |
515 | [[package]]
516 | name = "linux-raw-sys"
517 | version = "0.4.14"
518 | source = "registry+https://github.com/rust-lang/crates.io-index"
519 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
520 |
521 | [[package]]
522 | name = "log"
523 | version = "0.4.22"
524 | source = "registry+https://github.com/rust-lang/crates.io-index"
525 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
526 |
527 | [[package]]
528 | name = "log-panics"
529 | version = "2.1.0"
530 | source = "registry+https://github.com/rust-lang/crates.io-index"
531 | checksum = "68f9dd8546191c1850ecf67d22f5ff00a935b890d0e84713159a55495cc2ac5f"
532 | dependencies = [
533 | "log",
534 | ]
535 |
536 | [[package]]
537 | name = "lru"
538 | version = "0.12.3"
539 | source = "registry+https://github.com/rust-lang/crates.io-index"
540 | checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
541 | dependencies = [
542 | "hashbrown",
543 | ]
544 |
545 | [[package]]
546 | name = "lz4_flex"
547 | version = "0.11.3"
548 | source = "registry+https://github.com/rust-lang/crates.io-index"
549 | checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5"
550 |
551 | [[package]]
552 | name = "measure_time"
553 | version = "0.8.3"
554 | source = "registry+https://github.com/rust-lang/crates.io-index"
555 | checksum = "dbefd235b0aadd181626f281e1d684e116972988c14c264e42069d5e8a5775cc"
556 | dependencies = [
557 | "instant",
558 | "log",
559 | ]
560 |
561 | [[package]]
562 | name = "memchr"
563 | version = "2.7.4"
564 | source = "registry+https://github.com/rust-lang/crates.io-index"
565 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
566 |
567 | [[package]]
568 | name = "memmap2"
569 | version = "0.9.4"
570 | source = "registry+https://github.com/rust-lang/crates.io-index"
571 | checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
572 | dependencies = [
573 | "libc",
574 | ]
575 |
576 | [[package]]
577 | name = "minimal-lexical"
578 | version = "0.2.1"
579 | source = "registry+https://github.com/rust-lang/crates.io-index"
580 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
581 |
582 | [[package]]
583 | name = "mlua"
584 | version = "0.9.9"
585 | source = "registry+https://github.com/rust-lang/crates.io-index"
586 | checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7"
587 | dependencies = [
588 | "bstr",
589 | "mlua-sys",
590 | "mlua_derive",
591 | "num-traits",
592 | "once_cell",
593 | "rustc-hash 2.0.0",
594 | ]
595 |
596 | [[package]]
597 | name = "mlua-sys"
598 | version = "0.6.1"
599 | source = "registry+https://github.com/rust-lang/crates.io-index"
600 | checksum = "a088ed0723df7567f569ba018c5d48c23c501f3878b190b04144dfa5ebfa8abc"
601 | dependencies = [
602 | "cc",
603 | "cfg-if 1.0.0",
604 | "pkg-config",
605 | ]
606 |
607 | [[package]]
608 | name = "mlua_derive"
609 | version = "0.9.3"
610 | source = "registry+https://github.com/rust-lang/crates.io-index"
611 | checksum = "09697a6cec88e7f58a02c7ab5c18c611c6907c8654613df9cc0192658a4fb859"
612 | dependencies = [
613 | "proc-macro2",
614 | "quote",
615 | "syn",
616 | ]
617 |
618 | [[package]]
619 | name = "murmurhash32"
620 | version = "0.3.1"
621 | source = "registry+https://github.com/rust-lang/crates.io-index"
622 | checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b"
623 |
624 | [[package]]
625 | name = "neorg_se"
626 | version = "0.1.0"
627 | dependencies = [
628 | "anyhow",
629 | "colog",
630 | "dirs",
631 | "ignore",
632 | "log",
633 | "log-panics",
634 | "mlua",
635 | "neovim-lib",
636 | "once_cell",
637 | "regex",
638 | "serde",
639 | "serde_json",
640 | "simplelog",
641 | "tantivy",
642 | ]
643 |
644 | [[package]]
645 | name = "neovim-lib"
646 | version = "0.6.1"
647 | source = "registry+https://github.com/rust-lang/crates.io-index"
648 | checksum = "d6a8f5a1e1be160ce2b669c2c495a34ade6f3a525d4afafd7370c1792070f587"
649 | dependencies = [
650 | "log",
651 | "rmp",
652 | "rmpv",
653 | "unix_socket",
654 | ]
655 |
656 | [[package]]
657 | name = "nom"
658 | version = "7.1.3"
659 | source = "registry+https://github.com/rust-lang/crates.io-index"
660 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
661 | dependencies = [
662 | "memchr",
663 | "minimal-lexical",
664 | ]
665 |
666 | [[package]]
667 | name = "num-conv"
668 | version = "0.1.0"
669 | source = "registry+https://github.com/rust-lang/crates.io-index"
670 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
671 |
672 | [[package]]
673 | name = "num-traits"
674 | version = "0.2.19"
675 | source = "registry+https://github.com/rust-lang/crates.io-index"
676 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
677 | dependencies = [
678 | "autocfg",
679 | "libm",
680 | ]
681 |
682 | [[package]]
683 | name = "num_cpus"
684 | version = "1.16.0"
685 | source = "registry+https://github.com/rust-lang/crates.io-index"
686 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
687 | dependencies = [
688 | "hermit-abi",
689 | "libc",
690 | ]
691 |
692 | [[package]]
693 | name = "num_threads"
694 | version = "0.1.7"
695 | source = "registry+https://github.com/rust-lang/crates.io-index"
696 | checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
697 | dependencies = [
698 | "libc",
699 | ]
700 |
701 | [[package]]
702 | name = "once_cell"
703 | version = "1.19.0"
704 | source = "registry+https://github.com/rust-lang/crates.io-index"
705 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
706 |
707 | [[package]]
708 | name = "oneshot"
709 | version = "0.1.8"
710 | source = "registry+https://github.com/rust-lang/crates.io-index"
711 | checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29"
712 |
713 | [[package]]
714 | name = "option-ext"
715 | version = "0.2.0"
716 | source = "registry+https://github.com/rust-lang/crates.io-index"
717 | checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
718 |
719 | [[package]]
720 | name = "ownedbytes"
721 | version = "0.7.0"
722 | source = "registry+https://github.com/rust-lang/crates.io-index"
723 | checksum = "c3a059efb063b8f425b948e042e6b9bd85edfe60e913630ed727b23e2dfcc558"
724 | dependencies = [
725 | "stable_deref_trait",
726 | ]
727 |
728 | [[package]]
729 | name = "paste"
730 | version = "1.0.15"
731 | source = "registry+https://github.com/rust-lang/crates.io-index"
732 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
733 |
734 | [[package]]
735 | name = "pkg-config"
736 | version = "0.3.30"
737 | source = "registry+https://github.com/rust-lang/crates.io-index"
738 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
739 |
740 | [[package]]
741 | name = "powerfmt"
742 | version = "0.2.0"
743 | source = "registry+https://github.com/rust-lang/crates.io-index"
744 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
745 |
746 | [[package]]
747 | name = "ppv-lite86"
748 | version = "0.2.17"
749 | source = "registry+https://github.com/rust-lang/crates.io-index"
750 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
751 |
752 | [[package]]
753 | name = "proc-macro2"
754 | version = "1.0.86"
755 | source = "registry+https://github.com/rust-lang/crates.io-index"
756 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
757 | dependencies = [
758 | "unicode-ident",
759 | ]
760 |
761 | [[package]]
762 | name = "quote"
763 | version = "1.0.36"
764 | source = "registry+https://github.com/rust-lang/crates.io-index"
765 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
766 | dependencies = [
767 | "proc-macro2",
768 | ]
769 |
770 | [[package]]
771 | name = "rand"
772 | version = "0.8.5"
773 | source = "registry+https://github.com/rust-lang/crates.io-index"
774 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
775 | dependencies = [
776 | "libc",
777 | "rand_chacha",
778 | "rand_core",
779 | ]
780 |
781 | [[package]]
782 | name = "rand_chacha"
783 | version = "0.3.1"
784 | source = "registry+https://github.com/rust-lang/crates.io-index"
785 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
786 | dependencies = [
787 | "ppv-lite86",
788 | "rand_core",
789 | ]
790 |
791 | [[package]]
792 | name = "rand_core"
793 | version = "0.6.4"
794 | source = "registry+https://github.com/rust-lang/crates.io-index"
795 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
796 | dependencies = [
797 | "getrandom",
798 | ]
799 |
800 | [[package]]
801 | name = "rand_distr"
802 | version = "0.4.3"
803 | source = "registry+https://github.com/rust-lang/crates.io-index"
804 | checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31"
805 | dependencies = [
806 | "num-traits",
807 | "rand",
808 | ]
809 |
810 | [[package]]
811 | name = "rayon"
812 | version = "1.10.0"
813 | source = "registry+https://github.com/rust-lang/crates.io-index"
814 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
815 | dependencies = [
816 | "either",
817 | "rayon-core",
818 | ]
819 |
820 | [[package]]
821 | name = "rayon-core"
822 | version = "1.12.1"
823 | source = "registry+https://github.com/rust-lang/crates.io-index"
824 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
825 | dependencies = [
826 | "crossbeam-deque",
827 | "crossbeam-utils",
828 | ]
829 |
830 | [[package]]
831 | name = "redox_users"
832 | version = "0.4.5"
833 | source = "registry+https://github.com/rust-lang/crates.io-index"
834 | checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
835 | dependencies = [
836 | "getrandom",
837 | "libredox",
838 | "thiserror",
839 | ]
840 |
841 | [[package]]
842 | name = "regex"
843 | version = "1.10.5"
844 | source = "registry+https://github.com/rust-lang/crates.io-index"
845 | checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
846 | dependencies = [
847 | "aho-corasick",
848 | "memchr",
849 | "regex-automata",
850 | "regex-syntax",
851 | ]
852 |
853 | [[package]]
854 | name = "regex-automata"
855 | version = "0.4.7"
856 | source = "registry+https://github.com/rust-lang/crates.io-index"
857 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
858 | dependencies = [
859 | "aho-corasick",
860 | "memchr",
861 | "regex-syntax",
862 | ]
863 |
864 | [[package]]
865 | name = "regex-syntax"
866 | version = "0.8.4"
867 | source = "registry+https://github.com/rust-lang/crates.io-index"
868 | checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
869 |
870 | [[package]]
871 | name = "rmp"
872 | version = "0.8.14"
873 | source = "registry+https://github.com/rust-lang/crates.io-index"
874 | checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4"
875 | dependencies = [
876 | "byteorder",
877 | "num-traits",
878 | "paste",
879 | ]
880 |
881 | [[package]]
882 | name = "rmpv"
883 | version = "0.4.7"
884 | source = "registry+https://github.com/rust-lang/crates.io-index"
885 | checksum = "7c760afe11955e16121e36485b6b828326c3f0eaff1c31758d96dbeb5cf09fd5"
886 | dependencies = [
887 | "num-traits",
888 | "rmp",
889 | "serde",
890 | "serde_bytes",
891 | ]
892 |
893 | [[package]]
894 | name = "rust-stemmers"
895 | version = "1.2.0"
896 | source = "registry+https://github.com/rust-lang/crates.io-index"
897 | checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54"
898 | dependencies = [
899 | "serde",
900 | "serde_derive",
901 | ]
902 |
903 | [[package]]
904 | name = "rustc-hash"
905 | version = "1.1.0"
906 | source = "registry+https://github.com/rust-lang/crates.io-index"
907 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
908 |
909 | [[package]]
910 | name = "rustc-hash"
911 | version = "2.0.0"
912 | source = "registry+https://github.com/rust-lang/crates.io-index"
913 | checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
914 |
915 | [[package]]
916 | name = "rustix"
917 | version = "0.38.34"
918 | source = "registry+https://github.com/rust-lang/crates.io-index"
919 | checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
920 | dependencies = [
921 | "bitflags",
922 | "errno",
923 | "libc",
924 | "linux-raw-sys",
925 | "windows-sys 0.52.0",
926 | ]
927 |
928 | [[package]]
929 | name = "ryu"
930 | version = "1.0.18"
931 | source = "registry+https://github.com/rust-lang/crates.io-index"
932 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
933 |
934 | [[package]]
935 | name = "same-file"
936 | version = "1.0.6"
937 | source = "registry+https://github.com/rust-lang/crates.io-index"
938 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
939 | dependencies = [
940 | "winapi-util",
941 | ]
942 |
943 | [[package]]
944 | name = "serde"
945 | version = "1.0.204"
946 | source = "registry+https://github.com/rust-lang/crates.io-index"
947 | checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
948 | dependencies = [
949 | "serde_derive",
950 | ]
951 |
952 | [[package]]
953 | name = "serde_bytes"
954 | version = "0.11.15"
955 | source = "registry+https://github.com/rust-lang/crates.io-index"
956 | checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a"
957 | dependencies = [
958 | "serde",
959 | ]
960 |
961 | [[package]]
962 | name = "serde_derive"
963 | version = "1.0.204"
964 | source = "registry+https://github.com/rust-lang/crates.io-index"
965 | checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
966 | dependencies = [
967 | "proc-macro2",
968 | "quote",
969 | "syn",
970 | ]
971 |
972 | [[package]]
973 | name = "serde_json"
974 | version = "1.0.120"
975 | source = "registry+https://github.com/rust-lang/crates.io-index"
976 | checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
977 | dependencies = [
978 | "itoa",
979 | "ryu",
980 | "serde",
981 | ]
982 |
983 | [[package]]
984 | name = "simplelog"
985 | version = "0.12.2"
986 | source = "registry+https://github.com/rust-lang/crates.io-index"
987 | checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0"
988 | dependencies = [
989 | "log",
990 | "termcolor",
991 | "time",
992 | ]
993 |
994 | [[package]]
995 | name = "sketches-ddsketch"
996 | version = "0.2.2"
997 | source = "registry+https://github.com/rust-lang/crates.io-index"
998 | checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c"
999 | dependencies = [
1000 | "serde",
1001 | ]
1002 |
1003 | [[package]]
1004 | name = "smallvec"
1005 | version = "1.13.2"
1006 | source = "registry+https://github.com/rust-lang/crates.io-index"
1007 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
1008 |
1009 | [[package]]
1010 | name = "stable_deref_trait"
1011 | version = "1.2.0"
1012 | source = "registry+https://github.com/rust-lang/crates.io-index"
1013 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
1014 |
1015 | [[package]]
1016 | name = "syn"
1017 | version = "2.0.71"
1018 | source = "registry+https://github.com/rust-lang/crates.io-index"
1019 | checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462"
1020 | dependencies = [
1021 | "proc-macro2",
1022 | "quote",
1023 | "unicode-ident",
1024 | ]
1025 |
1026 | [[package]]
1027 | name = "tantivy"
1028 | version = "0.22.0"
1029 | source = "registry+https://github.com/rust-lang/crates.io-index"
1030 | checksum = "f8d0582f186c0a6d55655d24543f15e43607299425c5ad8352c242b914b31856"
1031 | dependencies = [
1032 | "aho-corasick",
1033 | "arc-swap",
1034 | "base64",
1035 | "bitpacking",
1036 | "byteorder",
1037 | "census",
1038 | "crc32fast",
1039 | "crossbeam-channel",
1040 | "downcast-rs",
1041 | "fastdivide",
1042 | "fnv",
1043 | "fs4",
1044 | "htmlescape",
1045 | "itertools",
1046 | "levenshtein_automata",
1047 | "log",
1048 | "lru",
1049 | "lz4_flex",
1050 | "measure_time",
1051 | "memmap2",
1052 | "num_cpus",
1053 | "once_cell",
1054 | "oneshot",
1055 | "rayon",
1056 | "regex",
1057 | "rust-stemmers",
1058 | "rustc-hash 1.1.0",
1059 | "serde",
1060 | "serde_json",
1061 | "sketches-ddsketch",
1062 | "smallvec",
1063 | "tantivy-bitpacker",
1064 | "tantivy-columnar",
1065 | "tantivy-common",
1066 | "tantivy-fst",
1067 | "tantivy-query-grammar",
1068 | "tantivy-stacker",
1069 | "tantivy-tokenizer-api",
1070 | "tempfile",
1071 | "thiserror",
1072 | "time",
1073 | "uuid",
1074 | "winapi",
1075 | ]
1076 |
1077 | [[package]]
1078 | name = "tantivy-bitpacker"
1079 | version = "0.6.0"
1080 | source = "registry+https://github.com/rust-lang/crates.io-index"
1081 | checksum = "284899c2325d6832203ac6ff5891b297fc5239c3dc754c5bc1977855b23c10df"
1082 | dependencies = [
1083 | "bitpacking",
1084 | ]
1085 |
1086 | [[package]]
1087 | name = "tantivy-columnar"
1088 | version = "0.3.0"
1089 | source = "registry+https://github.com/rust-lang/crates.io-index"
1090 | checksum = "12722224ffbe346c7fec3275c699e508fd0d4710e629e933d5736ec524a1f44e"
1091 | dependencies = [
1092 | "downcast-rs",
1093 | "fastdivide",
1094 | "itertools",
1095 | "serde",
1096 | "tantivy-bitpacker",
1097 | "tantivy-common",
1098 | "tantivy-sstable",
1099 | "tantivy-stacker",
1100 | ]
1101 |
1102 | [[package]]
1103 | name = "tantivy-common"
1104 | version = "0.7.0"
1105 | source = "registry+https://github.com/rust-lang/crates.io-index"
1106 | checksum = "8019e3cabcfd20a1380b491e13ff42f57bb38bf97c3d5fa5c07e50816e0621f4"
1107 | dependencies = [
1108 | "async-trait",
1109 | "byteorder",
1110 | "ownedbytes",
1111 | "serde",
1112 | "time",
1113 | ]
1114 |
1115 | [[package]]
1116 | name = "tantivy-fst"
1117 | version = "0.5.0"
1118 | source = "registry+https://github.com/rust-lang/crates.io-index"
1119 | checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18"
1120 | dependencies = [
1121 | "byteorder",
1122 | "regex-syntax",
1123 | "utf8-ranges",
1124 | ]
1125 |
1126 | [[package]]
1127 | name = "tantivy-query-grammar"
1128 | version = "0.22.0"
1129 | source = "registry+https://github.com/rust-lang/crates.io-index"
1130 | checksum = "847434d4af57b32e309f4ab1b4f1707a6c566656264caa427ff4285c4d9d0b82"
1131 | dependencies = [
1132 | "nom",
1133 | ]
1134 |
1135 | [[package]]
1136 | name = "tantivy-sstable"
1137 | version = "0.3.0"
1138 | source = "registry+https://github.com/rust-lang/crates.io-index"
1139 | checksum = "c69578242e8e9fc989119f522ba5b49a38ac20f576fc778035b96cc94f41f98e"
1140 | dependencies = [
1141 | "tantivy-bitpacker",
1142 | "tantivy-common",
1143 | "tantivy-fst",
1144 | "zstd",
1145 | ]
1146 |
1147 | [[package]]
1148 | name = "tantivy-stacker"
1149 | version = "0.3.0"
1150 | source = "registry+https://github.com/rust-lang/crates.io-index"
1151 | checksum = "c56d6ff5591fc332739b3ce7035b57995a3ce29a93ffd6012660e0949c956ea8"
1152 | dependencies = [
1153 | "murmurhash32",
1154 | "rand_distr",
1155 | "tantivy-common",
1156 | ]
1157 |
1158 | [[package]]
1159 | name = "tantivy-tokenizer-api"
1160 | version = "0.3.0"
1161 | source = "registry+https://github.com/rust-lang/crates.io-index"
1162 | checksum = "2a0dcade25819a89cfe6f17d932c9cedff11989936bf6dd4f336d50392053b04"
1163 | dependencies = [
1164 | "serde",
1165 | ]
1166 |
1167 | [[package]]
1168 | name = "tempfile"
1169 | version = "3.10.1"
1170 | source = "registry+https://github.com/rust-lang/crates.io-index"
1171 | checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
1172 | dependencies = [
1173 | "cfg-if 1.0.0",
1174 | "fastrand",
1175 | "rustix",
1176 | "windows-sys 0.52.0",
1177 | ]
1178 |
1179 | [[package]]
1180 | name = "termcolor"
1181 | version = "1.4.1"
1182 | source = "registry+https://github.com/rust-lang/crates.io-index"
1183 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
1184 | dependencies = [
1185 | "winapi-util",
1186 | ]
1187 |
1188 | [[package]]
1189 | name = "thiserror"
1190 | version = "1.0.62"
1191 | source = "registry+https://github.com/rust-lang/crates.io-index"
1192 | checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb"
1193 | dependencies = [
1194 | "thiserror-impl",
1195 | ]
1196 |
1197 | [[package]]
1198 | name = "thiserror-impl"
1199 | version = "1.0.62"
1200 | source = "registry+https://github.com/rust-lang/crates.io-index"
1201 | checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c"
1202 | dependencies = [
1203 | "proc-macro2",
1204 | "quote",
1205 | "syn",
1206 | ]
1207 |
1208 | [[package]]
1209 | name = "time"
1210 | version = "0.3.36"
1211 | source = "registry+https://github.com/rust-lang/crates.io-index"
1212 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
1213 | dependencies = [
1214 | "deranged",
1215 | "itoa",
1216 | "libc",
1217 | "num-conv",
1218 | "num_threads",
1219 | "powerfmt",
1220 | "serde",
1221 | "time-core",
1222 | "time-macros",
1223 | ]
1224 |
1225 | [[package]]
1226 | name = "time-core"
1227 | version = "0.1.2"
1228 | source = "registry+https://github.com/rust-lang/crates.io-index"
1229 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
1230 |
1231 | [[package]]
1232 | name = "time-macros"
1233 | version = "0.2.18"
1234 | source = "registry+https://github.com/rust-lang/crates.io-index"
1235 | checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
1236 | dependencies = [
1237 | "num-conv",
1238 | "time-core",
1239 | ]
1240 |
1241 | [[package]]
1242 | name = "unicode-ident"
1243 | version = "1.0.12"
1244 | source = "registry+https://github.com/rust-lang/crates.io-index"
1245 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
1246 |
1247 | [[package]]
1248 | name = "unix_socket"
1249 | version = "0.5.0"
1250 | source = "registry+https://github.com/rust-lang/crates.io-index"
1251 | checksum = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564"
1252 | dependencies = [
1253 | "cfg-if 0.1.10",
1254 | "libc",
1255 | ]
1256 |
1257 | [[package]]
1258 | name = "utf8-ranges"
1259 | version = "1.0.5"
1260 | source = "registry+https://github.com/rust-lang/crates.io-index"
1261 | checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba"
1262 |
1263 | [[package]]
1264 | name = "utf8parse"
1265 | version = "0.2.2"
1266 | source = "registry+https://github.com/rust-lang/crates.io-index"
1267 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
1268 |
1269 | [[package]]
1270 | name = "uuid"
1271 | version = "1.10.0"
1272 | source = "registry+https://github.com/rust-lang/crates.io-index"
1273 | checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
1274 | dependencies = [
1275 | "getrandom",
1276 | "serde",
1277 | ]
1278 |
1279 | [[package]]
1280 | name = "version_check"
1281 | version = "0.9.4"
1282 | source = "registry+https://github.com/rust-lang/crates.io-index"
1283 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1284 |
1285 | [[package]]
1286 | name = "walkdir"
1287 | version = "2.5.0"
1288 | source = "registry+https://github.com/rust-lang/crates.io-index"
1289 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
1290 | dependencies = [
1291 | "same-file",
1292 | "winapi-util",
1293 | ]
1294 |
1295 | [[package]]
1296 | name = "wasi"
1297 | version = "0.11.0+wasi-snapshot-preview1"
1298 | source = "registry+https://github.com/rust-lang/crates.io-index"
1299 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1300 |
1301 | [[package]]
1302 | name = "wasm-bindgen"
1303 | version = "0.2.92"
1304 | source = "registry+https://github.com/rust-lang/crates.io-index"
1305 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
1306 | dependencies = [
1307 | "cfg-if 1.0.0",
1308 | "wasm-bindgen-macro",
1309 | ]
1310 |
1311 | [[package]]
1312 | name = "wasm-bindgen-backend"
1313 | version = "0.2.92"
1314 | source = "registry+https://github.com/rust-lang/crates.io-index"
1315 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
1316 | dependencies = [
1317 | "bumpalo",
1318 | "log",
1319 | "once_cell",
1320 | "proc-macro2",
1321 | "quote",
1322 | "syn",
1323 | "wasm-bindgen-shared",
1324 | ]
1325 |
1326 | [[package]]
1327 | name = "wasm-bindgen-macro"
1328 | version = "0.2.92"
1329 | source = "registry+https://github.com/rust-lang/crates.io-index"
1330 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
1331 | dependencies = [
1332 | "quote",
1333 | "wasm-bindgen-macro-support",
1334 | ]
1335 |
1336 | [[package]]
1337 | name = "wasm-bindgen-macro-support"
1338 | version = "0.2.92"
1339 | source = "registry+https://github.com/rust-lang/crates.io-index"
1340 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
1341 | dependencies = [
1342 | "proc-macro2",
1343 | "quote",
1344 | "syn",
1345 | "wasm-bindgen-backend",
1346 | "wasm-bindgen-shared",
1347 | ]
1348 |
1349 | [[package]]
1350 | name = "wasm-bindgen-shared"
1351 | version = "0.2.92"
1352 | source = "registry+https://github.com/rust-lang/crates.io-index"
1353 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
1354 |
1355 | [[package]]
1356 | name = "web-sys"
1357 | version = "0.3.69"
1358 | source = "registry+https://github.com/rust-lang/crates.io-index"
1359 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
1360 | dependencies = [
1361 | "js-sys",
1362 | "wasm-bindgen",
1363 | ]
1364 |
1365 | [[package]]
1366 | name = "winapi"
1367 | version = "0.3.9"
1368 | source = "registry+https://github.com/rust-lang/crates.io-index"
1369 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1370 | dependencies = [
1371 | "winapi-i686-pc-windows-gnu",
1372 | "winapi-x86_64-pc-windows-gnu",
1373 | ]
1374 |
1375 | [[package]]
1376 | name = "winapi-i686-pc-windows-gnu"
1377 | version = "0.4.0"
1378 | source = "registry+https://github.com/rust-lang/crates.io-index"
1379 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1380 |
1381 | [[package]]
1382 | name = "winapi-util"
1383 | version = "0.1.8"
1384 | source = "registry+https://github.com/rust-lang/crates.io-index"
1385 | checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
1386 | dependencies = [
1387 | "windows-sys 0.52.0",
1388 | ]
1389 |
1390 | [[package]]
1391 | name = "winapi-x86_64-pc-windows-gnu"
1392 | version = "0.4.0"
1393 | source = "registry+https://github.com/rust-lang/crates.io-index"
1394 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1395 |
1396 | [[package]]
1397 | name = "windows-sys"
1398 | version = "0.48.0"
1399 | source = "registry+https://github.com/rust-lang/crates.io-index"
1400 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
1401 | dependencies = [
1402 | "windows-targets 0.48.5",
1403 | ]
1404 |
1405 | [[package]]
1406 | name = "windows-sys"
1407 | version = "0.52.0"
1408 | source = "registry+https://github.com/rust-lang/crates.io-index"
1409 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
1410 | dependencies = [
1411 | "windows-targets 0.52.6",
1412 | ]
1413 |
1414 | [[package]]
1415 | name = "windows-targets"
1416 | version = "0.48.5"
1417 | source = "registry+https://github.com/rust-lang/crates.io-index"
1418 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
1419 | dependencies = [
1420 | "windows_aarch64_gnullvm 0.48.5",
1421 | "windows_aarch64_msvc 0.48.5",
1422 | "windows_i686_gnu 0.48.5",
1423 | "windows_i686_msvc 0.48.5",
1424 | "windows_x86_64_gnu 0.48.5",
1425 | "windows_x86_64_gnullvm 0.48.5",
1426 | "windows_x86_64_msvc 0.48.5",
1427 | ]
1428 |
1429 | [[package]]
1430 | name = "windows-targets"
1431 | version = "0.52.6"
1432 | source = "registry+https://github.com/rust-lang/crates.io-index"
1433 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
1434 | dependencies = [
1435 | "windows_aarch64_gnullvm 0.52.6",
1436 | "windows_aarch64_msvc 0.52.6",
1437 | "windows_i686_gnu 0.52.6",
1438 | "windows_i686_gnullvm",
1439 | "windows_i686_msvc 0.52.6",
1440 | "windows_x86_64_gnu 0.52.6",
1441 | "windows_x86_64_gnullvm 0.52.6",
1442 | "windows_x86_64_msvc 0.52.6",
1443 | ]
1444 |
1445 | [[package]]
1446 | name = "windows_aarch64_gnullvm"
1447 | version = "0.48.5"
1448 | source = "registry+https://github.com/rust-lang/crates.io-index"
1449 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
1450 |
1451 | [[package]]
1452 | name = "windows_aarch64_gnullvm"
1453 | version = "0.52.6"
1454 | source = "registry+https://github.com/rust-lang/crates.io-index"
1455 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
1456 |
1457 | [[package]]
1458 | name = "windows_aarch64_msvc"
1459 | version = "0.48.5"
1460 | source = "registry+https://github.com/rust-lang/crates.io-index"
1461 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
1462 |
1463 | [[package]]
1464 | name = "windows_aarch64_msvc"
1465 | version = "0.52.6"
1466 | source = "registry+https://github.com/rust-lang/crates.io-index"
1467 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
1468 |
1469 | [[package]]
1470 | name = "windows_i686_gnu"
1471 | version = "0.48.5"
1472 | source = "registry+https://github.com/rust-lang/crates.io-index"
1473 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
1474 |
1475 | [[package]]
1476 | name = "windows_i686_gnu"
1477 | version = "0.52.6"
1478 | source = "registry+https://github.com/rust-lang/crates.io-index"
1479 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
1480 |
1481 | [[package]]
1482 | name = "windows_i686_gnullvm"
1483 | version = "0.52.6"
1484 | source = "registry+https://github.com/rust-lang/crates.io-index"
1485 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
1486 |
1487 | [[package]]
1488 | name = "windows_i686_msvc"
1489 | version = "0.48.5"
1490 | source = "registry+https://github.com/rust-lang/crates.io-index"
1491 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
1492 |
1493 | [[package]]
1494 | name = "windows_i686_msvc"
1495 | version = "0.52.6"
1496 | source = "registry+https://github.com/rust-lang/crates.io-index"
1497 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
1498 |
1499 | [[package]]
1500 | name = "windows_x86_64_gnu"
1501 | version = "0.48.5"
1502 | source = "registry+https://github.com/rust-lang/crates.io-index"
1503 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
1504 |
1505 | [[package]]
1506 | name = "windows_x86_64_gnu"
1507 | version = "0.52.6"
1508 | source = "registry+https://github.com/rust-lang/crates.io-index"
1509 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
1510 |
1511 | [[package]]
1512 | name = "windows_x86_64_gnullvm"
1513 | version = "0.48.5"
1514 | source = "registry+https://github.com/rust-lang/crates.io-index"
1515 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
1516 |
1517 | [[package]]
1518 | name = "windows_x86_64_gnullvm"
1519 | version = "0.52.6"
1520 | source = "registry+https://github.com/rust-lang/crates.io-index"
1521 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
1522 |
1523 | [[package]]
1524 | name = "windows_x86_64_msvc"
1525 | version = "0.48.5"
1526 | source = "registry+https://github.com/rust-lang/crates.io-index"
1527 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
1528 |
1529 | [[package]]
1530 | name = "windows_x86_64_msvc"
1531 | version = "0.52.6"
1532 | source = "registry+https://github.com/rust-lang/crates.io-index"
1533 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1534 |
1535 | [[package]]
1536 | name = "zerocopy"
1537 | version = "0.7.35"
1538 | source = "registry+https://github.com/rust-lang/crates.io-index"
1539 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
1540 | dependencies = [
1541 | "zerocopy-derive",
1542 | ]
1543 |
1544 | [[package]]
1545 | name = "zerocopy-derive"
1546 | version = "0.7.35"
1547 | source = "registry+https://github.com/rust-lang/crates.io-index"
1548 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
1549 | dependencies = [
1550 | "proc-macro2",
1551 | "quote",
1552 | "syn",
1553 | ]
1554 |
1555 | [[package]]
1556 | name = "zstd"
1557 | version = "0.13.2"
1558 | source = "registry+https://github.com/rust-lang/crates.io-index"
1559 | checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
1560 | dependencies = [
1561 | "zstd-safe",
1562 | ]
1563 |
1564 | [[package]]
1565 | name = "zstd-safe"
1566 | version = "7.2.0"
1567 | source = "registry+https://github.com/rust-lang/crates.io-index"
1568 | checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa"
1569 | dependencies = [
1570 | "zstd-sys",
1571 | ]
1572 |
1573 | [[package]]
1574 | name = "zstd-sys"
1575 | version = "2.0.12+zstd.1.5.6"
1576 | source = "registry+https://github.com/rust-lang/crates.io-index"
1577 | checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13"
1578 | dependencies = [
1579 | "cc",
1580 | "pkg-config",
1581 | ]
1582 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "neorg_se"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [lib]
9 | name = "neorg_se"
10 | crate-type = ["cdylib"]
11 |
12 | [features]
13 | luajit = ["mlua/luajit"]
14 | lua51 = ["mlua/lua51"]
15 |
16 | [dependencies]
17 | anyhow = "1.0.86"
18 | colog = "1.3.0"
19 | dirs = "5.0.1"
20 | ignore = "0.4.22"
21 | log = "0.4.22"
22 | log-panics = "2.1.0"
23 | mlua = { version = "0.9.9", features = ["module"] }
24 | neovim-lib = "0.6.1"
25 | once_cell = "1.19.0"
26 | regex = "1.10.5"
27 | serde = "1.0.204"
28 | serde_json = "1.0.120"
29 | simplelog = "0.12.2"
30 | tantivy = "0.22.0"
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Ben Lubas
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # neorg-se
2 |
3 | > [!WARNING]
4 | > This is a work in progress. Please pin your version and treat updating like installing a new
5 | > plugin until this warning is gone. Thanks!
6 |
7 | Search text file content via the [Tantivy](https://github.com/quickwit-oss/tantivy) search engine,
8 | all within Neovim.
9 |
10 | ---
11 |
12 | ## Commands
13 |
14 | - `Neorg search index` - Create the search engine index for the current workspace. This command is auto run in a separate
15 | thread when you load the plugin. It does not yet automatically update (WIP, and all that)
16 | - `Neorg search query fulltext` - "normal" search. Searches body text, title, and categories
17 | - `Neorg search query categories` - search for all files tagged with one or more categories
18 |
19 | ## Install
20 |
21 | **You need the rust toolchain installed or this plugin will not build**
22 |
23 |
24 | Lazy.nvim
25 |
26 | Can be listed as a dependency of `"nvim-neorg/neorg"`
27 | ```lua
28 | { "benlubas/neorg-se" }
29 | ```
30 |
31 |
32 |
33 | Rocks.nvim
34 |
35 | `:Rocks install neorg-se`
36 |
37 |
38 | ```lua
39 | ["external.search"] = {
40 | -- values shown are the default
41 | config = {
42 | -- Index the workspace when neovim launches. This process happens on a separate thread, so
43 | -- it doesn't significantly contribute to startup time or block neovim
44 | index_on_start = true,
45 | }
46 | },
47 | ```
48 |
49 | ## Integrations
50 |
51 | This plugin can also act as a category completion source for
52 | [benlubas/neorg-interim-ls](https://github.com/benlubas/neorg-interim-ls). No additional
53 | configuration is required here. Just install and load this module and configure the rest in
54 | neorg-interim-ls!
55 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "flake-parts": {
4 | "inputs": {
5 | "nixpkgs-lib": "nixpkgs-lib"
6 | },
7 | "locked": {
8 | "lastModified": 1717285511,
9 | "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
10 | "owner": "hercules-ci",
11 | "repo": "flake-parts",
12 | "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
13 | "type": "github"
14 | },
15 | "original": {
16 | "owner": "hercules-ci",
17 | "repo": "flake-parts",
18 | "type": "github"
19 | }
20 | },
21 | "flake-utils": {
22 | "inputs": {
23 | "systems": "systems"
24 | },
25 | "locked": {
26 | "lastModified": 1710146030,
27 | "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
28 | "owner": "numtide",
29 | "repo": "flake-utils",
30 | "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
31 | "type": "github"
32 | },
33 | "original": {
34 | "owner": "numtide",
35 | "repo": "flake-utils",
36 | "type": "github"
37 | }
38 | },
39 | "gen-luarc": {
40 | "inputs": {
41 | "flake-parts": "flake-parts",
42 | "nixpkgs": [
43 | "nixpkgs"
44 | ]
45 | },
46 | "locked": {
47 | "lastModified": 1718922730,
48 | "narHash": "sha256-ykhhOPqA9NzdNBr3ii+3h2DkK2+wasNqQLfMF6BXxTE=",
49 | "owner": "mrcjkb",
50 | "repo": "nix-gen-luarc-json",
51 | "rev": "021e8078e43884c6cdc70ca753d9a0b146cd55a4",
52 | "type": "github"
53 | },
54 | "original": {
55 | "owner": "mrcjkb",
56 | "repo": "nix-gen-luarc-json",
57 | "type": "github"
58 | }
59 | },
60 | "nixpkgs": {
61 | "locked": {
62 | "lastModified": 1719826879,
63 | "narHash": "sha256-xs7PlULe8O1SAcs/9e/HOjeUjBrU5FNtkAF/bSEcFto=",
64 | "owner": "NixOS",
65 | "repo": "nixpkgs",
66 | "rev": "b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8",
67 | "type": "github"
68 | },
69 | "original": {
70 | "owner": "NixOS",
71 | "ref": "nixpkgs-unstable",
72 | "repo": "nixpkgs",
73 | "type": "github"
74 | }
75 | },
76 | "nixpkgs-lib": {
77 | "locked": {
78 | "lastModified": 1717284937,
79 | "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
80 | "type": "tarball",
81 | "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
82 | },
83 | "original": {
84 | "type": "tarball",
85 | "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
86 | }
87 | },
88 | "root": {
89 | "inputs": {
90 | "flake-utils": "flake-utils",
91 | "gen-luarc": "gen-luarc",
92 | "nixpkgs": "nixpkgs"
93 | }
94 | },
95 | "systems": {
96 | "locked": {
97 | "lastModified": 1681028828,
98 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
99 | "owner": "nix-systems",
100 | "repo": "default",
101 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
102 | "type": "github"
103 | },
104 | "original": {
105 | "owner": "nix-systems",
106 | "repo": "default",
107 | "type": "github"
108 | }
109 | }
110 | },
111 | "root": "root",
112 | "version": 7
113 | }
114 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "Flake for Development";
3 |
4 | inputs = {
5 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6 | flake-utils.url = "github:numtide/flake-utils";
7 |
8 | gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
9 | gen-luarc.inputs.nixpkgs.follows = "nixpkgs";
10 | };
11 |
12 | outputs =
13 | {
14 | nixpkgs,
15 | flake-utils,
16 | gen-luarc,
17 | ...
18 | }:
19 |
20 | flake-utils.lib.eachDefaultSystem (
21 | system:
22 | let
23 | pkgs = import nixpkgs {
24 | inherit system;
25 | overlays = [ gen-luarc.overlays.default ];
26 | };
27 | in
28 | {
29 | devShells.default = pkgs.mkShell {
30 | name = "Neorg-SE DevShell";
31 |
32 | shellHook =
33 | let
34 | luarc = pkgs.mk-luarc-json {
35 | plugins = with pkgs; [
36 | vimPlugins.neorg
37 | lua51Packages.pathlib-nvim
38 | lua51Packages.nvim-nio
39 | lua51Packages.telescope-nvim
40 | ];
41 | };
42 | in
43 | # bash
44 | ''
45 | ln -fs ${luarc} .luarc.json
46 | '';
47 |
48 | packages =
49 | with pkgs;
50 | [
51 | lua-language-server
52 | stylua
53 | nil
54 | lua5_1
55 | ]
56 | ++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [ libiconv-darwin ]);
57 | };
58 | }
59 | );
60 | }
61 |
--------------------------------------------------------------------------------
/lua/neorg/modules/external/search/module.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | file: Search-Module
3 | title: The Power Of a Search Engine in Neorg
4 | summary: Search for files in your workspace using the Tantivy search engine.
5 | internal: false
6 | ---
7 |
8 | Searching things
9 |
10 | --]]
11 |
12 | local neorg = require("neorg.core")
13 | local modules = neorg.modules
14 | local log = neorg.log
15 |
16 | local module = modules.create("external.search")
17 |
18 | local sers
19 |
20 | module.config.public = {
21 | index_on_launch = true,
22 | }
23 |
24 | module.setup = function()
25 | local ok, res = pcall(require, "libneorg_se")
26 | if ok then
27 | sers = res
28 | else
29 | log.error("[Neorg Search] Failed to load `libneorg_se`.\n"..res)
30 | end
31 | return {
32 | success = ok,
33 | requires = {
34 | "core.dirman",
35 | "core.neorgcmd",
36 | "core.ui.text_popup",
37 | },
38 | }
39 | end
40 |
41 | local dirman
42 | module.load = function()
43 | log.info("loaded search module")
44 | module.required["core.neorgcmd"].add_commands_from_table({
45 | search = {
46 | min_args = 0,
47 | max_args = 1,
48 | name = "search",
49 | subcommands = {
50 | query = {
51 | min_args = 1,
52 | name = "search.query",
53 | subcommands = {
54 | fulltext = {
55 | name = "search.query.fulltext",
56 | args = 0,
57 | },
58 | categories = {
59 | name = "search.query.categories",
60 | args = 0,
61 | },
62 | },
63 | },
64 | index = {
65 | args = 0,
66 | name = "search.index",
67 | },
68 | },
69 | },
70 | })
71 |
72 | dirman = module.required["core.dirman"] ---@type core.dirman
73 |
74 | if module.config.public.index_on_launch then
75 | module.private["search.index"]()
76 | end
77 |
78 | --- Setup keybinds
79 | vim.keymap.set("n", "(neorg.search.categories)", module.private["search.query.categories"], { desc = "Search Neorg Categories" })
80 | vim.keymap.set("n", "(neorg.search.fulltext)", module.private["search.query.fulltext"], { desc = "Search Neorg Categories" })
81 | vim.keymap.set("n", "(neorg.search.update_index)", module.private["search.index"], { desc = "Search Neorg Categories" })
82 | end
83 |
84 | ---@class external.search
85 | module.public = {
86 | get_categories = function()
87 | -- return require("neorg_se").categories
88 | return sers.list_categories()
89 | end,
90 | }
91 |
92 | ---@class SearchResult
93 | ---@field file_path string absolute file path
94 | ---@field confidence number how close of a match this is (ideally they're already in sorted order though)
95 |
96 | ---@alias DocumentField "heading" | "metadata" | "categories" | "authors" | "title" | "body"
97 |
98 | module.events.subscribed = {
99 | ["core.neorgcmd"] = {
100 | ["search.query.fulltext"] = true,
101 | ["search.query.categories"] = true,
102 | ["search.index"] = true,
103 | },
104 | }
105 |
106 | module.on_event = function(event)
107 | if module.private[event.split_type[2]] then
108 | module.private[event.split_type[2]](event)
109 | end
110 | end
111 |
112 | module.private["search.query.fulltext"] = function(_)
113 | require("neorg_se").open_telescope_picker("fulltext")
114 | end
115 |
116 | module.private["search.query.categories"] = function(_)
117 | require("neorg_se").open_telescope_picker("categories")
118 | end
119 |
120 | module.private["search.index"] = function(_)
121 | local ws = dirman.get_current_workspace()
122 |
123 | -- note that this function spawns a thread to do the work and then returns immediately so it
124 | -- doesn't block or contribute to startup time
125 | sers.index(ws[1], tostring(ws[2]))
126 | end
127 |
128 | return module
129 |
--------------------------------------------------------------------------------
/lua/neorg_se/init.lua:
--------------------------------------------------------------------------------
1 | local pickers = require("telescope.pickers")
2 | local conf = require("telescope.config").values
3 | local log = require("neorg").log
4 | local finders = require("telescope.finders")
5 | local sers = require("libneorg_se")
6 | local sorters = require("telescope.sorters")
7 |
8 | local M = {}
9 |
10 | ---Show the results of a search engine query in a telescope picker. Meant to be called from rust.
11 | ---@param type "fulltext" | "categories" the type of query that's being run
12 | M.open_telescope_picker = function(type)
13 | local ok, err = pcall(function()
14 | pickers
15 | .new({}, {
16 | prompt_title = "Query Results (" .. type .. ")",
17 | finder = finders.new_dynamic({
18 | fn = function(query)
19 | return sers.query(type, query)
20 | end,
21 | entry_maker = function(entry)
22 | return {
23 | value = entry.path,
24 | display = ("%.2f: %s"):format(entry.score, entry.path),
25 | ordinal = entry.score,
26 | path = entry.path,
27 | }
28 | end,
29 | }),
30 | sorter = sorters.highlighter_only({}),
31 | previewer = conf.file_previewer({}),
32 | })
33 | :find()
34 | end)
35 | if not ok then
36 | log.error(err)
37 | end
38 | end
39 |
40 | return M
41 |
--------------------------------------------------------------------------------
/neorg-se-scm-1.rockspec:
--------------------------------------------------------------------------------
1 | local MODREV, SPECREV = "scm", "-1"
2 | rockspec_format = "3.0"
3 | package = "neorg-se"
4 | version = MODREV .. SPECREV
5 |
6 | description = {
7 | summary = "The power of a search engine for your Neorg notes",
8 | labels = { "neovim" },
9 | homepage = "https://github.com/benluas/neorg-se",
10 | license = "MIT",
11 | }
12 |
13 | source = {
14 | url = "http://github.com/benlubas/neorg-se/archive/v" .. MODREV .. ".zip",
15 | }
16 |
17 | if MODREV == "scm" then
18 | source = {
19 | url = "git://github.com/benlubas/neorg-se",
20 | }
21 | end
22 |
23 | dependencies = {
24 | "neorg ~> 8",
25 | "lua >= 5.1",
26 | "telescope.nvim",
27 | }
28 |
29 | build_dependencies = {
30 | "luarocks-build-rust-mlua",
31 | }
32 |
33 | build = {
34 | type = "rust-mlua",
35 |
36 | modules = {
37 | ["libneorg_se"] = "neorg_se",
38 | },
39 |
40 | install = {
41 | lua = {
42 | ["neorg_se.init"] = "lua/neorg_se/init.lua",
43 | ["neorg.modules.external.search.module"] = "lua/neorg/modules/external/search/module.lua",
44 | },
45 | },
46 | }
47 |
--------------------------------------------------------------------------------
/src/lib.rs:
--------------------------------------------------------------------------------
1 | mod search_engine;
2 |
3 | use std::{sync::RwLock, thread};
4 |
5 | use std::fs::File;
6 |
7 | use log::{info, warn, LevelFilter};
8 | use mlua::prelude::*;
9 | use once_cell::sync::Lazy;
10 | use simplelog::{CombinedLogger, Config, WriteLogger};
11 | use tantivy::schema::Value;
12 |
13 | use crate::search_engine::SearchEngine;
14 |
15 | pub enum QueryType {
16 | Fulltext,
17 | Categories,
18 | Unknown(String),
19 | }
20 |
21 | struct QueryResult {
22 | score: f32,
23 | path: String,
24 | }
25 |
26 | impl mlua::IntoLua<'_> for QueryResult {
27 | fn into_lua(self, lua: &mlua::Lua) -> LuaResult {
28 | let table = lua.create_table()?;
29 | table.set("score", self.score)?;
30 | table.set("path", self.path)?;
31 | Ok(mlua::Value::Table(table))
32 | }
33 | }
34 |
35 | static SEARCH_ENGINE: Lazy> = Lazy::new(|| {
36 | let home = std::env::var("HOME").unwrap();
37 | RwLock::new(SearchEngine::new(format!("{home}/.local/share/nvim/")))
38 | });
39 |
40 | fn query(
41 | _: &Lua,
42 | (query_type, query_str): (mlua::String, mlua::String),
43 | ) -> LuaResult> {
44 | info!("[QUERY] ({query_type:?}) `{query_str:?}`");
45 | let query_type = query_type.to_str()?;
46 | let query_str = query_str.to_str()?;
47 | let query_type = match query_type {
48 | "fulltext" => QueryType::Fulltext,
49 | "categories" => QueryType::Categories,
50 | s => QueryType::Unknown(s.to_string()),
51 | };
52 | if let Ok(search_engine) = SEARCH_ENGINE.read() {
53 | if let Ok(results) = search_engine.query(&query_type, query_str) {
54 | Ok(results
55 | .iter()
56 | .filter_map(|(score, r)| {
57 | if let Ok(field) = search_engine.schema.get_field("path") {
58 | r.get_all(field)
59 | .next()
60 | .unwrap()
61 | .as_str()
62 | .map(|path| QueryResult {
63 | score: *score,
64 | path: path.to_string(),
65 | })
66 | } else {
67 | None
68 | }
69 | })
70 | .collect())
71 | } else {
72 | Ok(vec![])
73 | }
74 | } else {
75 | Ok(vec![])
76 | }
77 | }
78 |
79 | fn index(_: &Lua, (ws_name, ws_path): (mlua::String, mlua::String)) -> LuaResult<()> {
80 | info!("[INDEX] start");
81 | let ws_path = ws_path.to_str()?.to_string();
82 | let ws_name = ws_name.to_str()?.to_string();
83 |
84 | info!("[INDEX] {ws_name}, {ws_path}");
85 | thread::spawn(move || {
86 | // Yeah I'm not stoked about this. But I think that it's fine. This is a data-race, but we
87 | // can't call into more than one function at a time. We're bound to one thread.
88 | if let Ok(mut search_engine) = SEARCH_ENGINE.write() {
89 | match search_engine.index(&ws_path, &ws_name) {
90 | Ok(_) => {
91 | info!("[Index] Success");
92 | }
93 | Err(e) => {
94 | info!("[Index] Failed with error: {e:?}");
95 | }
96 | };
97 | }
98 | });
99 |
100 | info!("[Index] returning");
101 |
102 | Ok(())
103 | }
104 |
105 | fn list_categories(_: &Lua, _: ()) -> LuaResult> {
106 | // set the categories
107 | match SEARCH_ENGINE.read() {
108 | Ok(search_engine) => {
109 | if let Ok(cats) = search_engine.list_categories() {
110 | info!("[LIST CATS] result: {cats:?}");
111 | Ok(cats)
112 | } else {
113 | // TODO: should this be a different error?
114 | Ok(vec![])
115 | }
116 | }
117 | Err(e) => {
118 | warn!("[LIST CATS] Failed to aquire read lock on SEARCH_ENGINE: {e:?}");
119 | Ok(vec![])
120 | }
121 | }
122 | }
123 |
124 | #[mlua::lua_module]
125 | fn libneorg_se(lua: &Lua) -> LuaResult {
126 | // Yeah I'm not sure where else this log setup could even go
127 | CombinedLogger::init(vec![WriteLogger::new(
128 | LevelFilter::Info,
129 | Config::default(),
130 | File::create("/tmp/neorg-SE.log").unwrap(),
131 | )])
132 | .unwrap();
133 | log_panics::init();
134 |
135 | let exports = lua.create_table()?;
136 | exports.set("query", lua.create_function(query)?)?;
137 | exports.set("index", lua.create_function(index)?)?;
138 | exports.set("list_categories", lua.create_function(list_categories)?)?;
139 |
140 | Ok(exports)
141 | }
142 |
--------------------------------------------------------------------------------
/src/main.rs.bak:
--------------------------------------------------------------------------------
1 | use log::{info, LevelFilter};
2 | use rpc_event_handler::EventHandler;
3 |
4 | mod rpc_event_handler;
5 | mod search_engine;
6 | use simplelog::*;
7 |
8 | use std::fs::File;
9 |
10 | // fn main() {
11 | // CombinedLogger::init(vec![
12 | // // NOTE: this should only be enabled when running the application from the command line.
13 | // // having it enabled when running with neovim will absolutely destroy the rpc connection
14 | // // over stdI/O
15 | // // TermLogger::new(
16 | // // LevelFilter::Info,
17 | // // Config::default(),
18 | // // TerminalMode::Mixed,
19 | // // ColorChoice::Auto,
20 | // // ),
21 | // WriteLogger::new(
22 | // LevelFilter::Info,
23 | // Config::default(),
24 | // File::create("/tmp/neorg-SE.log").unwrap(),
25 | // ),
26 | // ])
27 | // .unwrap();
28 | // log_panics::init();
29 | //
30 | // // use search_engine::ParsedDocument;
31 | // // let doc = ParsedDocument::from("/home/benlubas/notes/test1.norg");
32 | // // info!("Doc: {doc:?}");
33 | //
34 | // let mut event_handler = EventHandler::new();
35 | // info!("[MAIN] Neorg-SE launched successfully\n");
36 | // event_handler.handle_events();
37 | // }
38 |
39 | use mlua::prelude::*;
40 |
41 | fn hello(_: &Lua, name: String) -> LuaResult<()> {
42 | println!("hello, {}!", name);
43 | Ok(())
44 | }
45 |
46 | #[mlua::lua_module]
47 | fn my_module(lua: &Lua) -> LuaResult {
48 | let exports = lua.create_table()?;
49 | exports.set("hello", lua.create_function(hello)?)?;
50 | Ok(exports)
51 | }
52 |
--------------------------------------------------------------------------------
/src/search_engine.rs:
--------------------------------------------------------------------------------
1 | use anyhow::anyhow;
2 | use ignore::WalkBuilder;
3 | use once_cell::sync::Lazy;
4 | use regex::Regex;
5 | use std::io;
6 | use std::path::Path;
7 | use tantivy::aggregation::agg_req::Aggregations;
8 | use tantivy::aggregation::agg_result::AggregationResults;
9 | use tantivy::aggregation::AggregationCollector;
10 |
11 | use log::{error, info, warn};
12 | use tantivy::collector::TopDocs;
13 | use tantivy::query::{AllQuery, QueryParser};
14 | use tantivy::{schema::*, IndexReader};
15 | use tantivy::{Index, IndexWriter, ReloadPolicy};
16 |
17 | use std::fs;
18 |
19 | use crate::QueryType;
20 |
21 | #[derive(Debug)]
22 | pub struct ParsedDocument {
23 | pub title: String,
24 | pub categories: Vec,
25 | pub body: String,
26 | }
27 |
28 | impl ParsedDocument {
29 | pub fn new(file_path: &str) -> io::Result {
30 | let contents = fs::read_to_string(file_path)?;
31 | let mut stripped_contents = contents.clone();
32 |
33 | static METADATA_RE: Lazy =
34 | Lazy::new(|| Regex::new(r"(?ms)\A(\s*@document.meta\s*(.*?)@end\s*)$").unwrap());
35 |
36 | let mut title = "";
37 | let mut categories: Vec = vec![];
38 | if let Some((_, [full_meta_tag, metadata])) = METADATA_RE
39 | .captures_iter(&contents)
40 | .map(|c| c.extract())
41 | .next()
42 | {
43 | info!("Metadata:\n{metadata}");
44 | static TITLE_RE: Lazy =
45 | Lazy::new(|| Regex::new(r"(?m)^title\:\s*(.*)$").unwrap());
46 | if let Some((_, [captured_title])) =
47 | TITLE_RE.captures_iter(metadata).map(|c| c.extract()).next()
48 | {
49 | title = captured_title;
50 | }
51 |
52 | static CATEGORIES_RE: Lazy = Lazy::new(|| {
53 | Regex::new(r"categories:\s*\[((?s).*?)\]|(?m)categories:\s*(\w+)$").unwrap()
54 | });
55 | categories = CATEGORIES_RE
56 | .captures_iter(metadata)
57 | .map(|c| c.extract::<1>().1[0].to_string())
58 | .collect();
59 | categories = categories
60 | .iter()
61 | .flat_map(|s| s.split_whitespace())
62 | .map(|s| s.to_string())
63 | .collect();
64 | info!("{categories:?}");
65 |
66 | stripped_contents = contents[full_meta_tag.len()..].to_string();
67 | }
68 |
69 | Ok(ParsedDocument {
70 | title: title.to_string(),
71 | categories,
72 | body: stripped_contents,
73 | })
74 | }
75 | }
76 |
77 | pub struct SearchEngine {
78 | pub data_path: String,
79 | pub schema: Schema,
80 | pub index: Option,
81 | pub reader: Option,
82 | }
83 |
84 | impl SearchEngine {
85 | pub fn new(data_path: String) -> SearchEngine {
86 | let mut schema_builder = Schema::builder();
87 | schema_builder.add_text_field("title", TEXT);
88 |
89 | // using this special type so we can run aggregation queries against this field
90 | let text_fieldtype = TextOptions::default()
91 | .set_indexing_options(
92 | TextFieldIndexing::default()
93 | .set_index_option(IndexRecordOption::WithFreqs)
94 | .set_tokenizer("raw"),
95 | )
96 | .set_fast(None)
97 | .set_stored();
98 | schema_builder.add_text_field("categories", text_fieldtype);
99 | // schema_builder.add_text_field("categories", TEXT); // this is how we used to add the categories field
100 | schema_builder.add_text_field("path", TEXT | STORED);
101 | schema_builder.add_text_field("body", TEXT);
102 | // TODO: Maybe search for an existing index at the data_path and read it if it exists?
103 | SearchEngine {
104 | data_path,
105 | schema: schema_builder.build(),
106 | index: None,
107 | reader: None,
108 | }
109 | }
110 |
111 | /// Take a workspaces of files, traverse, parse and add them to the index
112 | pub fn index(&mut self, ws_path: &str, ws_name: &str) -> tantivy::Result<()> {
113 | let ws_data_path = self.data_path.to_string() + "/" + ws_name + "/";
114 | // TODO: reuse existing index from disk potentially with cache?
115 | // Figure out how to determine which files need updating. Is it even a concern? Indexing is
116 | // very fast.
117 | if Path::new(&ws_data_path).exists() {
118 | info!("path exists, removing it");
119 | match fs::remove_dir_all(&ws_data_path) {
120 | Ok(_) => info!("Removed path"),
121 | Err(e) => warn!("Failed to remove path: {e:?}"),
122 | }
123 | }
124 | match fs::create_dir(Path::new(&ws_data_path)) {
125 | Ok(s) => info!("ok, {s:?}"),
126 | Err(e) => warn!("not okay: {e:?}"),
127 | }
128 | let index = Index::create_in_dir(ws_data_path, self.schema.clone())?;
129 | let mut index_writer: IndexWriter = index.writer(50_000_000)?;
130 |
131 | // TODO: This should be multithreaded via `.build_parallel()` but there's a really
132 | // confusing interface to it, and little documentation if any.
133 |
134 | // NOTE: just reading all these and parsing them initially takes a full second for my notes
135 | // repository. This operation does need to become multithreaded, even though it doesn't
136 | // block nvim, it will take a while on slower machines with even larger note pools, which
137 | // isn't ideal.
138 | let walker = WalkBuilder::new(Path::new(ws_path)).build();
139 | for result in walker {
140 | match result {
141 | Ok(entry) => {
142 | info!("File Entry: {entry:?}");
143 | let path = entry.path().to_string_lossy();
144 | if let Ok(document) = ParsedDocument::new(&path) {
145 | info!("Document: {document:?}");
146 | let mut new_doc = tantivy::TantivyDocument::default();
147 | new_doc.add_text(self.schema.get_field("title")?, document.title);
148 | for cat in document.categories {
149 | new_doc.add_text(self.schema.get_field("categories")?, cat);
150 | }
151 | new_doc.add_text(self.schema.get_field("path")?, path);
152 | new_doc.add_text(self.schema.get_field("body")?, document.body);
153 | index_writer.add_document(new_doc)?;
154 | }
155 | }
156 | Err(err) => error!("{err}"),
157 | }
158 | }
159 | index_writer.commit()?;
160 | self.index = Some(index);
161 | self.aquire_reader()?;
162 |
163 | Ok(())
164 | }
165 |
166 | /// Setup the reader. This is a searcher pool that auto reloads when the index is updated.
167 | /// We're not really making use of it, typically you would have one reader that you acquire
168 | /// many searchers from; in this case we're no server, we're just using one searcher.
169 | fn aquire_reader(&mut self) -> tantivy::Result<()> {
170 | if let Some(index) = &self.index {
171 | self.reader = Some(
172 | index
173 | .reader_builder()
174 | .reload_policy(ReloadPolicy::OnCommitWithDelay)
175 | .try_into()?,
176 | );
177 | }
178 | Ok(())
179 | }
180 |
181 | pub fn query(
182 | &self,
183 | query_type: &QueryType,
184 | query_str: &str,
185 | ) -> anyhow::Result> {
186 | if let Some(reader) = &self.reader {
187 | // acquiring a searcher is cheap. One searcher should be used per user request.
188 | let searcher = reader.searcher();
189 |
190 | let search_fields = match query_type {
191 | QueryType::Fulltext => vec![
192 | self.schema.get_field("title")?,
193 | self.schema.get_field("body")?,
194 | self.schema.get_field("categories")?,
195 | ],
196 | QueryType::Categories => vec![self.schema.get_field("categories")?],
197 | QueryType::Unknown(s) => {
198 | if let Ok(field) = self.schema.get_field(s) {
199 | vec![field]
200 | } else {
201 | warn!("[QUERY] Invalid schema field passed: {s}");
202 | return Ok(vec![])
203 | }
204 | }
205 | };
206 |
207 | // Search the title and body fields if the user doesn't specify
208 | let query_parser = QueryParser::for_index(self.index.as_ref().unwrap(), search_fields);
209 |
210 | let query = query_parser.parse_query(query_str)?;
211 | let top_docs = searcher.search(&query, &TopDocs::with_limit(10))?;
212 | let mut results: Vec<(f32, TantivyDocument)> = vec![];
213 | for (score, doc_address) in top_docs {
214 | let retrieved_doc: TantivyDocument = searcher.doc(doc_address)?;
215 | let json = retrieved_doc.to_json(&self.schema);
216 | info!("{score}: {}", json);
217 |
218 | results.push((score, retrieved_doc));
219 | }
220 |
221 | return Ok(results);
222 | }
223 |
224 | Err(anyhow!("Failed to aquire reader"))
225 | }
226 |
227 | pub fn list_categories(&self) -> anyhow::Result> {
228 | if let Some(reader) = &self.reader {
229 | info!("[LIST CATS] Aggregating");
230 | let searcher = reader.searcher();
231 | let agg_req: Aggregations = serde_json::from_value(serde_json::json!(
232 | {
233 | "category_counts": {
234 | "terms": {
235 | "field": "categories",
236 | "size": 1000
237 | }
238 | }
239 | }
240 | ))?;
241 | let collector = AggregationCollector::from_aggs(agg_req, Default::default());
242 |
243 | let agg_res: AggregationResults = searcher.search(&AllQuery, &collector).unwrap();
244 | let res: serde_json::Value = serde_json::to_value(agg_res)?;
245 | let cats: Vec = res
246 | .get("category_counts")
247 | .unwrap()
248 | .get("buckets")
249 | .unwrap()
250 | .as_array()
251 | .unwrap()
252 | .iter()
253 | .map(|value| value.get("key").unwrap().as_str().unwrap().to_string())
254 | .collect();
255 | Ok(cats)
256 | } else {
257 | Err(anyhow!("Never aquired tantivy reader"))
258 | }
259 | }
260 | }
261 |
--------------------------------------------------------------------------------
/stylua.toml:
--------------------------------------------------------------------------------
1 | column_width = 120
2 | line_endings = "Unix"
3 | indent_type = "Spaces"
4 | indent_width = 4
5 | quote_style = "AutoPreferDouble"
6 | no_call_parentheses = false
7 |
--------------------------------------------------------------------------------