lucivy-wasm 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/js/lucivy.d.ts +8 -0
- package/package.json +1 -1
- package/pkg/lucivy.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
# lucivy-wasm 4.0
|
|
1
|
+
# lucivy-wasm 4.1.0
|
|
2
2
|
|
|
3
3
|
**One index answers every question, and every answer is checked.** The default index answers exact substrings, matches across separators, typos across token boundaries, regular expressions and two-character needles — with BM25 and the exact bytes of every match — and nothing to configure per question; the ground-truth harness compares every answer to a scan of the files. In the browser — the same engine as the native bindings, built with emscripten: **threads** (pthreads over SharedArrayBuffer), OPFS persistence, snapshot import. Runs in a Web Worker. MIT.
|
|
4
4
|
|
|
5
5
|
[**Try the live playground**](https://l-defraiteur.github.io/lucivy/) — it clones lucivy's own source from GitHub and indexes it in your browser.
|
|
6
6
|
|
|
7
|
+
### What's new in 4.1
|
|
8
|
+
|
|
9
|
+
- **`positions: false` in `IndexConfig` — about 40 % less OPFS** (typed in `lucivy.d.ts`). The postings keep each token's documents and frequencies instead of its positions, and no position sidecar is written; every match is verified on the stored text — same documents, spans and scores. Measured in Chrome on Linux kernel files: 2 000 files 268 → 174 MB, **10 000 files 1 052 → 638 MB**, indexed in 37 s instead of 43, the tab's memory peak unchanged (1.5 GB); the playground's 21-query parity panel returns the same counts, top 10, scores and spans on both indexes (the differences: equal scores ordered otherwise, and spans the default index of 4.0.2 returned twice — fixed in 4.1). Natively the whole kernel goes 5 289 → 2 598 MB. Every text field must be stored (the default); excludes `derived_in_ram`; fixed at creation. The playground builds its index this way with `?nopos`.
|
|
10
|
+
- **Fix: one occurrence, one span.** In relaxed mode a needle that ends a word cut into chunks — `lock` in `superblock` — came back twice, and counted twice in the score (542 duplicated spans for `lock` over 10 000 kernel files, since the v3 engine, 4.0.2 included); the ground-truth harness now counts duplicates too
|
|
11
|
+
|
|
7
12
|
### What's new in 4.0.0
|
|
8
13
|
|
|
9
14
|
- **The index is 3.7× smaller**, and a tab holds a whole repository: the playground's prompt indexes MDN Web Docs (14 611 pages, 14 s), the **entire Linux 2.6.0 kernel** (14 032 files, 28 s, 1.1 GB held in memory), Go, Godot, **TypeScript (39 044 files, 33 s)**, PostgreSQL, CPython, Redis, Git, curl, SQLite, nginx — `index <name>`, kept in OPFS, reopened in seconds. The ceiling of a tab is about 200 MB of text. Browser against native on the 2.6.0 kernel: same counts and spans, 41 s to index against 23, substrings 10-18 ms against 2 ([README](https://github.com/L-Defraiteur/lucivy/blob/main/README.md#browser-against-native)).
|
|
@@ -21,7 +26,7 @@ Same 93 983 Linux kernel files, 857 MB of text. Each engine is configured at its
|
|
|
21
26
|
|---|---|---|---|---|
|
|
22
27
|
| `spin_lock`, separators relaxed (also `spin lock`, `spin-lock`, `spinlock`) | 9 552 | **9 552**, 23 ms | 6 577 — not with this analyzer: its trigrams carry the underscore | 6 601 — relaxed is the only mode it has: the separator never enters its index |
|
|
23
28
|
| `spinlokc`, two edits, across the token boundary | 10 034 | **10 034**, 148 ms | 3 549 — fuzziness compares whole terms | 6 557 — same |
|
|
24
|
-
| `spin_lock_[a-z]+`, a regex | 5 510 | **5 510**, 219 ms | 5
|
|
29
|
+
| `spin_lock_[a-z]+`, a regex, case folded | 5 510 | **5 510**, 219 ms | 5 510 on the wildcard field, 1 ms warm — as `[a-zA-Z]+`: Lucene's `case_insensitive` folds a pattern's literals, not its character classes | 0 — terms are already cut |
|
|
25
30
|
| `de`, two characters | 93 009 | **93 009**, 7.7 M spans, 561 ms | 0, silently | 0, silently |
|
|
26
31
|
| `retur -ENOMEM`, a fuzzy phrase | 14 449 | **14 449**, 30 ms | 14 446 (`span_near`), 24 ms — it does this well | — |
|
|
27
32
|
| **where it matched**: `mutex_lock`, 5 145 documents | 20 797 spans | **all 20 797, 15 ms** | `highlight` on the top 200: 179 ms | verifying 5 145 stored texts: 96 ms |
|
|
@@ -126,6 +131,10 @@ const index = await lucivy.create('/my-index', {
|
|
|
126
131
|
// derived_in_ram: true — the three derived sidecars of each segment
|
|
127
132
|
// (about a third of the index) are rebuilt in memory when the index
|
|
128
133
|
// opens instead of written to OPFS. Same answers. Off by default.
|
|
134
|
+
// positions: false (4.1) — documents and frequencies instead of
|
|
135
|
+
// positions, no position sidecar: about 40 % less OPFS; every match is
|
|
136
|
+
// verified on the stored text, same answers. Text fields must be stored
|
|
137
|
+
// (the default); excludes derived_in_ram. On by default.
|
|
129
138
|
});
|
|
130
139
|
|
|
131
140
|
// Open an existing index from OPFS
|
package/js/lucivy.d.ts
CHANGED
|
@@ -327,6 +327,14 @@ export interface IndexConfig {
|
|
|
327
327
|
* Off by default; fixed at creation.
|
|
328
328
|
*/
|
|
329
329
|
derived_in_ram?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* `false` keeps each token's documents and frequencies instead of its
|
|
332
|
+
* positions and writes no position sidecar (37 % smaller on 10 000 kernel
|
|
333
|
+
* files); every match is verified on the stored text, so every text field
|
|
334
|
+
* must be stored. Same documents, spans and scores. Excludes
|
|
335
|
+
* `derived_in_ram`. On by default; fixed at creation.
|
|
336
|
+
*/
|
|
337
|
+
positions?: boolean;
|
|
330
338
|
/**
|
|
331
339
|
* Shared dictionary only. A commit returns before the shard's new texts
|
|
332
340
|
* are merged into the dictionary (a background task does it); a search
|
package/package.json
CHANGED
package/pkg/lucivy.wasm
CHANGED
|
Binary file
|