@taladb/web 0.9.4 → 0.10.1
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/LICENSE +202 -21
- package/README.md +3 -3
- package/package.json +5 -5
- package/pkg/README.md +3 -3
- package/pkg/package.json +3 -3
- package/pkg/taladb_web.d.ts +49 -7
- package/pkg/taladb_web.js +179 -15
- package/pkg/taladb_web_bg.wasm +0 -0
- package/pkg/taladb_web_bg.wasm.d.ts +13 -7
- package/worker/taladb.worker.js +24 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2025-2026 taladb
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Browser WASM bindings for TalaDB — persistent local-first storage via WASM + OPFS.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@taladb/web)
|
|
6
|
-
[](LICENSE)
|
|
7
7
|
|
|
8
8
|
> **Note:** Most users should install [`taladb`](https://www.npmjs.com/package/taladb) instead, which auto-selects this package when running in the browser.
|
|
9
9
|
|
|
@@ -86,8 +86,8 @@ pnpm --filter @taladb/web build
|
|
|
86
86
|
|
|
87
87
|
## Full Documentation
|
|
88
88
|
|
|
89
|
-
**[https://
|
|
89
|
+
**[https://taladb.github.io/taladb/guide/web](https://taladb.github.io/taladb/guide/web)**
|
|
90
90
|
|
|
91
91
|
## License
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Apache 2.0 © [TalaDB](https://github.com/taladb)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taladb/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "TalaDB WASM bindings — document queries and vector search in the browser",
|
|
5
5
|
"main": "pkg/taladb_web.js",
|
|
6
6
|
"types": "pkg/taladb_web.d.ts",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
],
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/
|
|
21
|
+
"url": "https://github.com/taladb/taladb.git",
|
|
22
22
|
"directory": "packages/bindings/web"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://
|
|
24
|
+
"homepage": "https://taladb.github.io/taladb/guide/web",
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/taladb/taladb/issues"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=18"
|
|
30
30
|
},
|
|
31
|
-
"license": "
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "wasm-pack build --target web --out-dir pkg --release",
|
|
34
34
|
"build:dev": "wasm-pack build --target web --out-dir pkg --dev",
|
package/pkg/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Browser WASM bindings for TalaDB — persistent local-first storage via WASM + OPFS.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@taladb/web)
|
|
6
|
-
[](LICENSE)
|
|
7
7
|
|
|
8
8
|
> **Note:** Most users should install [`taladb`](https://www.npmjs.com/package/taladb) instead, which auto-selects this package when running in the browser.
|
|
9
9
|
|
|
@@ -86,8 +86,8 @@ pnpm --filter @taladb/web build
|
|
|
86
86
|
|
|
87
87
|
## Full Documentation
|
|
88
88
|
|
|
89
|
-
**[https://
|
|
89
|
+
**[https://taladb.github.io/taladb/guide/web](https://taladb.github.io/taladb/guide/web)**
|
|
90
90
|
|
|
91
91
|
## License
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Apache 2.0 © [TalaDB](https://github.com/taladb)
|
package/pkg/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "taladb-web",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"collaborators": [
|
|
5
|
-
"
|
|
5
|
+
"taladb"
|
|
6
6
|
],
|
|
7
7
|
"description": "TalaDB browser WASM bindings (wasm-bindgen + OPFS) and Cloudflare Workers",
|
|
8
|
-
"version": "0.
|
|
9
|
-
"license": "
|
|
8
|
+
"version": "0.10.1",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
10
|
"files": [
|
|
11
11
|
"taladb_web_bg.wasm",
|
|
12
12
|
"taladb_web.js",
|
package/pkg/taladb_web.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export class CollectionWasm {
|
|
|
18
18
|
* Create a compound index. `fields_json` is a JSON array of field names.
|
|
19
19
|
*/
|
|
20
20
|
createCompoundIndex(fields_json: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Create a full-text search index on a string field.
|
|
23
|
+
*/
|
|
24
|
+
createFtsIndex(field: string): void;
|
|
21
25
|
/**
|
|
22
26
|
* Create a secondary index on a field.
|
|
23
27
|
*/
|
|
@@ -48,6 +52,10 @@ export class CollectionWasm {
|
|
|
48
52
|
* Drop a compound index by its ordered field list (`fields_json`).
|
|
49
53
|
*/
|
|
50
54
|
dropCompoundIndex(fields_json: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Drop a full-text search index and everything it stores.
|
|
57
|
+
*/
|
|
58
|
+
dropFtsIndex(field: string): void;
|
|
51
59
|
/**
|
|
52
60
|
* Drop a secondary index.
|
|
53
61
|
*/
|
|
@@ -73,6 +81,14 @@ export class CollectionWasm {
|
|
|
73
81
|
* Find a single document. Returns the document or null.
|
|
74
82
|
*/
|
|
75
83
|
findOne(filter: any): any;
|
|
84
|
+
/**
|
|
85
|
+
* Hybrid retrieval — BM25 and vector similarity fused with reciprocal
|
|
86
|
+
* rank fusion.
|
|
87
|
+
*
|
|
88
|
+
* `options` accepts `{ rrfK, textWeight, vectorWeight, candidates, k1, b }`.
|
|
89
|
+
* Returns a JSON array of `{ document, score, textRank, vectorRank }`.
|
|
90
|
+
*/
|
|
91
|
+
hybridSearch(text_field: string, text: string, vector_field: string, vector: Float32Array, top_k: number, filter: any, options: any): any;
|
|
76
92
|
/**
|
|
77
93
|
* Insert a document. Accepts a plain JS object, returns the ULID string id.
|
|
78
94
|
*/
|
|
@@ -93,6 +109,12 @@ export class CollectionWasm {
|
|
|
93
109
|
* or `"local"` for ordinary user writes.
|
|
94
110
|
*/
|
|
95
111
|
replaceManyWithIds(docs: any, origin: string): any;
|
|
112
|
+
/**
|
|
113
|
+
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
114
|
+
*
|
|
115
|
+
* Returns a JSON array of `{ document, score }`.
|
|
116
|
+
*/
|
|
117
|
+
searchText(field: string, query: string, top_k: number, filter: any, options: any): any;
|
|
96
118
|
/**
|
|
97
119
|
* Update all matching documents. Returns the count updated.
|
|
98
120
|
*/
|
|
@@ -281,6 +303,14 @@ export class WorkerDB {
|
|
|
281
303
|
* default immediate durability. Backs `db.flush()`.
|
|
282
304
|
*/
|
|
283
305
|
flush(): void;
|
|
306
|
+
/**
|
|
307
|
+
* Hybrid retrieval — BM25 and vector similarity fused with reciprocal
|
|
308
|
+
* rank fusion.
|
|
309
|
+
*
|
|
310
|
+
* `options_json` accepts `{ rrfK, textWeight, vectorWeight, candidates, k1, b }`.
|
|
311
|
+
* Returns a JSON array of `{ document, score, textRank, vectorRank }`.
|
|
312
|
+
*/
|
|
313
|
+
hybridSearch(collection: string, text_field: string, text: string, vector_field: string, vector_json: string, top_k: number, filter_json: string, options_json: string): string;
|
|
284
314
|
/**
|
|
285
315
|
* Import a remote changeset and merge it into the local database using
|
|
286
316
|
* Last-Write-Wins conflict resolution.
|
|
@@ -388,6 +418,12 @@ export class WorkerDB {
|
|
|
388
418
|
* never replicate back out — see `Collection::replace_many_with_ids`.
|
|
389
419
|
*/
|
|
390
420
|
replaceManyWithIds(collection: string, docs_json: string, origin: string): string;
|
|
421
|
+
/**
|
|
422
|
+
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
423
|
+
*
|
|
424
|
+
* Returns a JSON array of `{ document, score }`.
|
|
425
|
+
*/
|
|
426
|
+
searchText(collection: string, field: string, query: string, top_k: number, filter_json: string, options_json: string): string;
|
|
391
427
|
/**
|
|
392
428
|
* Set write durability: `eventual = true` batches OPFS fsyncs for
|
|
393
429
|
* throughput (call `flush()` to force), `false` (default) fsyncs each
|
|
@@ -498,6 +534,7 @@ export interface InitOutput {
|
|
|
498
534
|
readonly workerdb_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number, number];
|
|
499
535
|
readonly workerdb_findOne: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
500
536
|
readonly workerdb_flush: (a: number) => [number, number];
|
|
537
|
+
readonly workerdb_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => [number, number, number, number];
|
|
501
538
|
readonly workerdb_importChangeset: (a: number, b: number, c: number) => [number, number, number];
|
|
502
539
|
readonly workerdb_importChangesetValidated: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
503
540
|
readonly workerdb_insert: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
@@ -511,6 +548,7 @@ export interface InitOutput {
|
|
|
511
548
|
readonly workerdb_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
512
549
|
readonly workerdb_quarantined: (a: number, b: number, c: number) => [number, number, number, number];
|
|
513
550
|
readonly workerdb_replaceManyWithIds: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
551
|
+
readonly workerdb_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
514
552
|
readonly workerdb_setDurability: (a: number, b: number) => void;
|
|
515
553
|
readonly workerdb_setUserVersion: (a: number, b: number) => [number, number];
|
|
516
554
|
readonly workerdb_syncPending: (a: number) => bigint;
|
|
@@ -524,20 +562,24 @@ export interface InitOutput {
|
|
|
524
562
|
readonly collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
525
563
|
readonly collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
526
564
|
readonly collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
565
|
+
readonly collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
527
566
|
readonly collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
528
567
|
readonly collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
529
568
|
readonly collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
530
569
|
readonly collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
531
570
|
readonly collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
532
571
|
readonly collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
572
|
+
readonly collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
533
573
|
readonly collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
534
574
|
readonly collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
535
575
|
readonly collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
536
576
|
readonly collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
537
577
|
readonly collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
578
|
+
readonly collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
538
579
|
readonly collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
539
580
|
readonly collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
540
581
|
readonly collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
582
|
+
readonly collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
541
583
|
readonly collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
542
584
|
readonly collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
543
585
|
readonly collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
@@ -558,13 +600,13 @@ export interface InitOutput {
|
|
|
558
600
|
readonly opfs_delete_snapshot: (a: number, b: number) => any;
|
|
559
601
|
readonly opfs_flush_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
560
602
|
readonly opfs_load_snapshot: (a: number, b: number) => any;
|
|
561
|
-
readonly
|
|
562
|
-
readonly
|
|
563
|
-
readonly
|
|
564
|
-
readonly
|
|
565
|
-
readonly
|
|
566
|
-
readonly
|
|
567
|
-
readonly
|
|
603
|
+
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output_______: (a: number, b: number) => void;
|
|
604
|
+
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
605
|
+
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___: (a: number, b: number) => void;
|
|
606
|
+
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
607
|
+
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
608
|
+
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
609
|
+
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
568
610
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
569
611
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
570
612
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/pkg/taladb_web.js
CHANGED
|
@@ -55,6 +55,18 @@ export class CollectionWasm {
|
|
|
55
55
|
throw takeFromExternrefTable0(ret[0]);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a full-text search index on a string field.
|
|
60
|
+
* @param {string} field
|
|
61
|
+
*/
|
|
62
|
+
createFtsIndex(field) {
|
|
63
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
64
|
+
const len0 = WASM_VECTOR_LEN;
|
|
65
|
+
const ret = wasm.collectionwasm_createFtsIndex(this.__wbg_ptr, ptr0, len0);
|
|
66
|
+
if (ret[1]) {
|
|
67
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
58
70
|
/**
|
|
59
71
|
* Create a secondary index on a field.
|
|
60
72
|
* @param {string} field
|
|
@@ -145,6 +157,18 @@ export class CollectionWasm {
|
|
|
145
157
|
throw takeFromExternrefTable0(ret[0]);
|
|
146
158
|
}
|
|
147
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Drop a full-text search index and everything it stores.
|
|
162
|
+
* @param {string} field
|
|
163
|
+
*/
|
|
164
|
+
dropFtsIndex(field) {
|
|
165
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
167
|
+
const ret = wasm.collectionwasm_dropFtsIndex(this.__wbg_ptr, ptr0, len0);
|
|
168
|
+
if (ret[1]) {
|
|
169
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
148
172
|
/**
|
|
149
173
|
* Drop a secondary index.
|
|
150
174
|
* @param {string} field
|
|
@@ -217,6 +241,36 @@ export class CollectionWasm {
|
|
|
217
241
|
}
|
|
218
242
|
return takeFromExternrefTable0(ret[0]);
|
|
219
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Hybrid retrieval — BM25 and vector similarity fused with reciprocal
|
|
246
|
+
* rank fusion.
|
|
247
|
+
*
|
|
248
|
+
* `options` accepts `{ rrfK, textWeight, vectorWeight, candidates, k1, b }`.
|
|
249
|
+
* Returns a JSON array of `{ document, score, textRank, vectorRank }`.
|
|
250
|
+
* @param {string} text_field
|
|
251
|
+
* @param {string} text
|
|
252
|
+
* @param {string} vector_field
|
|
253
|
+
* @param {Float32Array} vector
|
|
254
|
+
* @param {number} top_k
|
|
255
|
+
* @param {any} filter
|
|
256
|
+
* @param {any} options
|
|
257
|
+
* @returns {any}
|
|
258
|
+
*/
|
|
259
|
+
hybridSearch(text_field, text, vector_field, vector, top_k, filter, options) {
|
|
260
|
+
const ptr0 = passStringToWasm0(text_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
262
|
+
const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
263
|
+
const len1 = WASM_VECTOR_LEN;
|
|
264
|
+
const ptr2 = passStringToWasm0(vector_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
+
const len2 = WASM_VECTOR_LEN;
|
|
266
|
+
const ptr3 = passArrayF32ToWasm0(vector, wasm.__wbindgen_malloc);
|
|
267
|
+
const len3 = WASM_VECTOR_LEN;
|
|
268
|
+
const ret = wasm.collectionwasm_hybridSearch(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, top_k, filter, options);
|
|
269
|
+
if (ret[2]) {
|
|
270
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
271
|
+
}
|
|
272
|
+
return takeFromExternrefTable0(ret[0]);
|
|
273
|
+
}
|
|
220
274
|
/**
|
|
221
275
|
* Insert a document. Accepts a plain JS object, returns the ULID string id.
|
|
222
276
|
* @param {any} doc
|
|
@@ -275,6 +329,28 @@ export class CollectionWasm {
|
|
|
275
329
|
}
|
|
276
330
|
return takeFromExternrefTable0(ret[0]);
|
|
277
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
334
|
+
*
|
|
335
|
+
* Returns a JSON array of `{ document, score }`.
|
|
336
|
+
* @param {string} field
|
|
337
|
+
* @param {string} query
|
|
338
|
+
* @param {number} top_k
|
|
339
|
+
* @param {any} filter
|
|
340
|
+
* @param {any} options
|
|
341
|
+
* @returns {any}
|
|
342
|
+
*/
|
|
343
|
+
searchText(field, query, top_k, filter, options) {
|
|
344
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
345
|
+
const len0 = WASM_VECTOR_LEN;
|
|
346
|
+
const ptr1 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
347
|
+
const len1 = WASM_VECTOR_LEN;
|
|
348
|
+
const ret = wasm.collectionwasm_searchText(this.__wbg_ptr, ptr0, len0, ptr1, len1, top_k, filter, options);
|
|
349
|
+
if (ret[2]) {
|
|
350
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
351
|
+
}
|
|
352
|
+
return takeFromExternrefTable0(ret[0]);
|
|
353
|
+
}
|
|
278
354
|
/**
|
|
279
355
|
* Update all matching documents. Returns the count updated.
|
|
280
356
|
* @param {any} filter
|
|
@@ -924,6 +1000,54 @@ export class WorkerDB {
|
|
|
924
1000
|
throw takeFromExternrefTable0(ret[0]);
|
|
925
1001
|
}
|
|
926
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Hybrid retrieval — BM25 and vector similarity fused with reciprocal
|
|
1005
|
+
* rank fusion.
|
|
1006
|
+
*
|
|
1007
|
+
* `options_json` accepts `{ rrfK, textWeight, vectorWeight, candidates, k1, b }`.
|
|
1008
|
+
* Returns a JSON array of `{ document, score, textRank, vectorRank }`.
|
|
1009
|
+
* @param {string} collection
|
|
1010
|
+
* @param {string} text_field
|
|
1011
|
+
* @param {string} text
|
|
1012
|
+
* @param {string} vector_field
|
|
1013
|
+
* @param {string} vector_json
|
|
1014
|
+
* @param {number} top_k
|
|
1015
|
+
* @param {string} filter_json
|
|
1016
|
+
* @param {string} options_json
|
|
1017
|
+
* @returns {string}
|
|
1018
|
+
*/
|
|
1019
|
+
hybridSearch(collection, text_field, text, vector_field, vector_json, top_k, filter_json, options_json) {
|
|
1020
|
+
let deferred9_0;
|
|
1021
|
+
let deferred9_1;
|
|
1022
|
+
try {
|
|
1023
|
+
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1024
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1025
|
+
const ptr1 = passStringToWasm0(text_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1026
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1027
|
+
const ptr2 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1028
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1029
|
+
const ptr3 = passStringToWasm0(vector_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1030
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1031
|
+
const ptr4 = passStringToWasm0(vector_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1032
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1033
|
+
const ptr5 = passStringToWasm0(filter_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1034
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1035
|
+
const ptr6 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1036
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1037
|
+
const ret = wasm.workerdb_hybridSearch(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, top_k, ptr5, len5, ptr6, len6);
|
|
1038
|
+
var ptr8 = ret[0];
|
|
1039
|
+
var len8 = ret[1];
|
|
1040
|
+
if (ret[3]) {
|
|
1041
|
+
ptr8 = 0; len8 = 0;
|
|
1042
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1043
|
+
}
|
|
1044
|
+
deferred9_0 = ptr8;
|
|
1045
|
+
deferred9_1 = len8;
|
|
1046
|
+
return getStringFromWasm0(ptr8, len8);
|
|
1047
|
+
} finally {
|
|
1048
|
+
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
927
1051
|
/**
|
|
928
1052
|
* Import a remote changeset and merge it into the local database using
|
|
929
1053
|
* Last-Write-Wins conflict resolution.
|
|
@@ -1255,6 +1379,46 @@ export class WorkerDB {
|
|
|
1255
1379
|
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
1256
1380
|
}
|
|
1257
1381
|
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
1384
|
+
*
|
|
1385
|
+
* Returns a JSON array of `{ document, score }`.
|
|
1386
|
+
* @param {string} collection
|
|
1387
|
+
* @param {string} field
|
|
1388
|
+
* @param {string} query
|
|
1389
|
+
* @param {number} top_k
|
|
1390
|
+
* @param {string} filter_json
|
|
1391
|
+
* @param {string} options_json
|
|
1392
|
+
* @returns {string}
|
|
1393
|
+
*/
|
|
1394
|
+
searchText(collection, field, query, top_k, filter_json, options_json) {
|
|
1395
|
+
let deferred7_0;
|
|
1396
|
+
let deferred7_1;
|
|
1397
|
+
try {
|
|
1398
|
+
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1399
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1400
|
+
const ptr1 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1401
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1402
|
+
const ptr2 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1403
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1404
|
+
const ptr3 = passStringToWasm0(filter_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1405
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1406
|
+
const ptr4 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1407
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1408
|
+
const ret = wasm.workerdb_searchText(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, top_k, ptr3, len3, ptr4, len4);
|
|
1409
|
+
var ptr6 = ret[0];
|
|
1410
|
+
var len6 = ret[1];
|
|
1411
|
+
if (ret[3]) {
|
|
1412
|
+
ptr6 = 0; len6 = 0;
|
|
1413
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1414
|
+
}
|
|
1415
|
+
deferred7_0 = ptr6;
|
|
1416
|
+
deferred7_1 = len6;
|
|
1417
|
+
return getStringFromWasm0(ptr6, len6);
|
|
1418
|
+
} finally {
|
|
1419
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1258
1422
|
/**
|
|
1259
1423
|
* Set write durability: `eventual = true` batches OPFS fsyncs for
|
|
1260
1424
|
* throughput (call `flush()` to force), `false` (default) fsyncs each
|
|
@@ -1864,7 +2028,7 @@ function __wbg_get_imports() {
|
|
|
1864
2028
|
const a = state0.a;
|
|
1865
2029
|
state0.a = 0;
|
|
1866
2030
|
try {
|
|
1867
|
-
return
|
|
2031
|
+
return wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1868
2032
|
} finally {
|
|
1869
2033
|
state0.a = a;
|
|
1870
2034
|
}
|
|
@@ -1886,7 +2050,7 @@ function __wbg_get_imports() {
|
|
|
1886
2050
|
const a = state0.a;
|
|
1887
2051
|
state0.a = 0;
|
|
1888
2052
|
try {
|
|
1889
|
-
return
|
|
2053
|
+
return wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1890
2054
|
} finally {
|
|
1891
2055
|
state0.a = a;
|
|
1892
2056
|
}
|
|
@@ -2070,18 +2234,18 @@ function __wbg_get_imports() {
|
|
|
2070
2234
|
return ret;
|
|
2071
2235
|
},
|
|
2072
2236
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2073
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2074
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2237
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 142, function: Function { arguments: [Externref], shim_idx: 143, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2238
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output_______, wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_);
|
|
2075
2239
|
return ret;
|
|
2076
2240
|
},
|
|
2077
2241
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2078
2242
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 222, function: Function { arguments: [], shim_idx: 223, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2079
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2243
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut_____Output_______, wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_);
|
|
2080
2244
|
return ret;
|
|
2081
2245
|
},
|
|
2082
2246
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2083
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2084
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2247
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 702, function: Function { arguments: [Externref], shim_idx: 703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2248
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___, wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_);
|
|
2085
2249
|
return ret;
|
|
2086
2250
|
},
|
|
2087
2251
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2132,23 +2296,23 @@ function __wbg_get_imports() {
|
|
|
2132
2296
|
};
|
|
2133
2297
|
}
|
|
2134
2298
|
|
|
2135
|
-
function
|
|
2136
|
-
wasm.
|
|
2299
|
+
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
2300
|
+
wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_(arg0, arg1);
|
|
2137
2301
|
}
|
|
2138
2302
|
|
|
2139
|
-
function
|
|
2140
|
-
wasm.
|
|
2303
|
+
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2) {
|
|
2304
|
+
wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2);
|
|
2141
2305
|
}
|
|
2142
2306
|
|
|
2143
|
-
function
|
|
2144
|
-
const ret = wasm.
|
|
2307
|
+
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_(arg0, arg1, arg2) {
|
|
2308
|
+
const ret = wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_(arg0, arg1, arg2);
|
|
2145
2309
|
if (ret[1]) {
|
|
2146
2310
|
throw takeFromExternrefTable0(ret[0]);
|
|
2147
2311
|
}
|
|
2148
2312
|
}
|
|
2149
2313
|
|
|
2150
|
-
function
|
|
2151
|
-
wasm.
|
|
2314
|
+
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
2315
|
+
wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
2152
2316
|
}
|
|
2153
2317
|
|
|
2154
2318
|
|
package/pkg/taladb_web_bg.wasm
CHANGED
|
Binary file
|
|
@@ -23,6 +23,7 @@ export const workerdb_find: (a: number, b: number, c: number, d: number, e: numb
|
|
|
23
23
|
export const workerdb_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number, number];
|
|
24
24
|
export const workerdb_findOne: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
25
25
|
export const workerdb_flush: (a: number) => [number, number];
|
|
26
|
+
export const workerdb_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => [number, number, number, number];
|
|
26
27
|
export const workerdb_importChangeset: (a: number, b: number, c: number) => [number, number, number];
|
|
27
28
|
export const workerdb_importChangesetValidated: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
28
29
|
export const workerdb_insert: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
@@ -36,6 +37,7 @@ export const workerdb_openWithOpfs: (a: any) => [number, number, number];
|
|
|
36
37
|
export const workerdb_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
37
38
|
export const workerdb_quarantined: (a: number, b: number, c: number) => [number, number, number, number];
|
|
38
39
|
export const workerdb_replaceManyWithIds: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
40
|
+
export const workerdb_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number, number];
|
|
39
41
|
export const workerdb_setDurability: (a: number, b: number) => void;
|
|
40
42
|
export const workerdb_setUserVersion: (a: number, b: number) => [number, number];
|
|
41
43
|
export const workerdb_syncPending: (a: number) => bigint;
|
|
@@ -49,20 +51,24 @@ export const __wbg_taladbwasm_free: (a: number, b: number) => void;
|
|
|
49
51
|
export const collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
50
52
|
export const collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
51
53
|
export const collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
54
|
+
export const collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
52
55
|
export const collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
53
56
|
export const collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
54
57
|
export const collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
55
58
|
export const collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
56
59
|
export const collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
57
60
|
export const collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
61
|
+
export const collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
58
62
|
export const collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
59
63
|
export const collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
60
64
|
export const collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
61
65
|
export const collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
62
66
|
export const collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
67
|
+
export const collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
63
68
|
export const collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
64
69
|
export const collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
65
70
|
export const collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
71
|
+
export const collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
66
72
|
export const collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
67
73
|
export const collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
68
74
|
export const collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
@@ -83,13 +89,13 @@ export const is_opfs_available: () => any;
|
|
|
83
89
|
export const opfs_delete_snapshot: (a: number, b: number) => any;
|
|
84
90
|
export const opfs_flush_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
85
91
|
export const opfs_load_snapshot: (a: number, b: number) => any;
|
|
86
|
-
export const
|
|
87
|
-
export const
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
92
|
+
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output_______: (a: number, b: number) => void;
|
|
93
|
+
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
94
|
+
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___: (a: number, b: number) => void;
|
|
95
|
+
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
96
|
+
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
97
|
+
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
98
|
+
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
93
99
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
94
100
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
95
101
|
export const __wbindgen_exn_store: (a: number) => void;
|
package/worker/taladb.worker.js
CHANGED
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
* dropVectorIndex { collection, field }
|
|
50
50
|
* upgradeVectorIndex { collection, field }
|
|
51
51
|
* findNearest { collection, field, queryJson, topK, filterJson? }
|
|
52
|
+
* searchText { collection, field, query, topK, filterJson?, optionsJson? }
|
|
53
|
+
* hybridSearch { collection, textField, text, vectorField, vectorJson, topK, filterJson?, optionsJson? }
|
|
52
54
|
* listCollections {} → JSON string[]
|
|
53
55
|
* compact {} → null
|
|
54
56
|
* compactTombstones { collection, beforeMs } → number pruned
|
|
@@ -536,6 +538,28 @@ async function dispatch(op, args) {
|
|
|
536
538
|
args.filterJson ?? 'null',
|
|
537
539
|
);
|
|
538
540
|
|
|
541
|
+
case 'searchText':
|
|
542
|
+
return db.searchText(
|
|
543
|
+
args.collection,
|
|
544
|
+
args.field,
|
|
545
|
+
args.query,
|
|
546
|
+
args.topK,
|
|
547
|
+
args.filterJson ?? 'null',
|
|
548
|
+
args.optionsJson ?? 'null',
|
|
549
|
+
);
|
|
550
|
+
|
|
551
|
+
case 'hybridSearch':
|
|
552
|
+
return db.hybridSearch(
|
|
553
|
+
args.collection,
|
|
554
|
+
args.textField,
|
|
555
|
+
args.text,
|
|
556
|
+
args.vectorField,
|
|
557
|
+
args.vectorJson,
|
|
558
|
+
args.topK,
|
|
559
|
+
args.filterJson ?? 'null',
|
|
560
|
+
args.optionsJson ?? 'null',
|
|
561
|
+
);
|
|
562
|
+
|
|
539
563
|
case 'listCollections':
|
|
540
564
|
return db.listCollections();
|
|
541
565
|
|