@infino-ai/infino 0.7.1 → 0.8.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/infino/index.d.ts +9 -0
- package/infino/index.js +12 -0
- package/infino/native.d.ts +72 -3
- package/package.json +7 -7
package/infino/index.d.ts
CHANGED
|
@@ -157,6 +157,15 @@ export declare class Table {
|
|
|
157
157
|
* append == one commit.
|
|
158
158
|
*/
|
|
159
159
|
append(data: AppendData): void;
|
|
160
|
+
/**
|
|
161
|
+
* {@link append}, naming the source the rows came from. The superfiles
|
|
162
|
+
* this commit writes are keyed `data/<stem>-<uuid>.sf.parquet`, with the
|
|
163
|
+
* stem the key-safe form of `sourceName` (lowercase `[a-z0-9_]`), so a
|
|
164
|
+
* bucket listing shows where each came from. The table behaves exactly as
|
|
165
|
+
* after `append`; the name is a label on the object key. Not available on
|
|
166
|
+
* a hosted table.
|
|
167
|
+
*/
|
|
168
|
+
appendNamed(data: AppendData, sourceName: string): void;
|
|
160
169
|
/** Ranked BM25 search; rows as records (or an Arrow `Table`). `score` is a
|
|
161
170
|
* similarity (higher is better) — opposite direction from `vectorSearch`'s
|
|
162
171
|
* distance. Fuse with `hybridSearch`. */
|
package/infino/index.js
CHANGED
|
@@ -250,6 +250,18 @@ class Table {
|
|
|
250
250
|
const ipc = dataToIpc(data, () => this.schema());
|
|
251
251
|
guard(this.remote, () => this.inner.append(ipc));
|
|
252
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* {@link append}, naming the source the rows came from. The superfiles
|
|
255
|
+
* this commit writes are keyed `data/<stem>-<uuid>.sf.parquet`, with the
|
|
256
|
+
* stem the key-safe form of `sourceName` (lowercase `[a-z0-9_]`), so a
|
|
257
|
+
* bucket listing shows where each came from. The table behaves exactly as
|
|
258
|
+
* after `append`; the name is a label on the object key. Not available on
|
|
259
|
+
* a hosted table.
|
|
260
|
+
*/
|
|
261
|
+
appendNamed(data, sourceName) {
|
|
262
|
+
const ipc = dataToIpc(data, () => this.schema());
|
|
263
|
+
guard(this.remote, () => this.inner.appendNamed(ipc, sourceName));
|
|
264
|
+
}
|
|
253
265
|
bm25Search(column, query, k, opts = {}) {
|
|
254
266
|
const buf = guard(this.remote, () => this.inner.bm25Search(column, query, k, opts.mode, opts.stats, opts.projection));
|
|
255
267
|
return decode(buf, opts.arrow);
|
package/infino/native.d.ts
CHANGED
|
@@ -99,6 +99,46 @@ export interface FtsOptions {
|
|
|
99
99
|
* table and cannot be changed afterwards.
|
|
100
100
|
*/
|
|
101
101
|
analyzer?: string
|
|
102
|
+
/**
|
|
103
|
+
* Remove this column's stopwords — the very common words whose
|
|
104
|
+
* presence says almost nothing about what a document is about.
|
|
105
|
+
* `"english"` is the only set; omit for none (the default).
|
|
106
|
+
*
|
|
107
|
+
* Applies to both sides: the words leave the index and they leave
|
|
108
|
+
* a query, and each one removed leaves a hole in the token
|
|
109
|
+
* positions, so an exact phrase still knows the words it matched
|
|
110
|
+
* were not adjacent in the text. The trade is that once a word is
|
|
111
|
+
* not indexed, no query can find it — declare it on prose, not on
|
|
112
|
+
* short identifiers. Recorded with the table and unchangeable
|
|
113
|
+
* afterwards, since it decides what is in the index: the words it
|
|
114
|
+
* removed were never written, so changing it means re-ingesting
|
|
115
|
+
* from the source text. With `stored: false` that text is never
|
|
116
|
+
* kept, so the combination is permanent.
|
|
117
|
+
*/
|
|
118
|
+
stopwords?: string
|
|
119
|
+
/**
|
|
120
|
+
* Reduce this column's words to their stems, so a search for one
|
|
121
|
+
* inflection finds the others (`running`, `runs`, `run`).
|
|
122
|
+
* `"english"` is the only stemmer; omit for none (the default).
|
|
123
|
+
*
|
|
124
|
+
* Applies to both sides, like `stopwords`. The trade is precision:
|
|
125
|
+
* stemming conflates words a reader would not, and there is no way
|
|
126
|
+
* to ask for an unstemmed form on a stemmed column. Recorded with
|
|
127
|
+
* the table and unchangeable afterwards: a stem is not invertible
|
|
128
|
+
* — the index holds `run`, never the `running` it came from — so
|
|
129
|
+
* changing it means re-ingesting from the source text, and with
|
|
130
|
+
* `stored: false` that text is never kept, making the combination
|
|
131
|
+
* permanent.
|
|
132
|
+
*/
|
|
133
|
+
stemmer?: string
|
|
134
|
+
/**
|
|
135
|
+
* Record token positions, which is what exact phrase queries
|
|
136
|
+
* (`'"climate policy"'`) need. Default false: positions roughly
|
|
137
|
+
* double the column's index footprint, so they are a per-column
|
|
138
|
+
* opt-in. A column without them answers a phrase query with an
|
|
139
|
+
* error naming the column, never a silent bag-of-words fallback.
|
|
140
|
+
*/
|
|
141
|
+
positions?: boolean
|
|
102
142
|
/**
|
|
103
143
|
* Keep the raw text in the table (default true). `false` makes the
|
|
104
144
|
* column index-only: searchable, but the text is never stored, so
|
|
@@ -106,6 +146,18 @@ export interface FtsOptions {
|
|
|
106
146
|
* batches still carry it).
|
|
107
147
|
*/
|
|
108
148
|
stored?: boolean
|
|
149
|
+
/**
|
|
150
|
+
* BM25 term-frequency saturation, `> 0`; defaults to 1.2. Recorded
|
|
151
|
+
* with the table, and the stored score bounds are built with it,
|
|
152
|
+
* so a search that does not override it pays nothing. Pass with
|
|
153
|
+
* `b` or not at all.
|
|
154
|
+
*/
|
|
155
|
+
k1?: number
|
|
156
|
+
/**
|
|
157
|
+
* BM25 length normalization, in `[0, 1]`; defaults to 0.75. Pass
|
|
158
|
+
* with `k1` or not at all.
|
|
159
|
+
*/
|
|
160
|
+
b?: number
|
|
109
161
|
}
|
|
110
162
|
/**
|
|
111
163
|
* Open (or create) a catalog rooted at `uri` (local dir, `memory://`, or
|
|
@@ -128,8 +180,9 @@ export declare function builderId(): string
|
|
|
128
180
|
export declare class IndexSpec {
|
|
129
181
|
constructor()
|
|
130
182
|
/**
|
|
131
|
-
* Mark `column` (a UTF-8 string column) as full-text indexed,
|
|
132
|
-
*
|
|
183
|
+
* Mark `column` (a UTF-8 string column) as full-text indexed, with
|
|
184
|
+
* optional per-column `options` (analyzer, stopwords, stemmer,
|
|
185
|
+
* positions, stored, k1/b).
|
|
133
186
|
*/
|
|
134
187
|
fts(column: string, options?: FtsOptions | undefined | null): IndexSpec
|
|
135
188
|
/**
|
|
@@ -181,6 +234,14 @@ export declare class Table {
|
|
|
181
234
|
* concatenated into one commit; an empty stream is a no-op.
|
|
182
235
|
*/
|
|
183
236
|
append(data: Buffer): void
|
|
237
|
+
/**
|
|
238
|
+
* `append`, naming the source the rows came from: the superfiles this
|
|
239
|
+
* commit writes are keyed `data/<stem>-<uuid>.sf.parquet`, with the stem
|
|
240
|
+
* the key-safe form of `sourceName` (lowercase `[a-z0-9_]`), so a bucket
|
|
241
|
+
* listing shows where each came from. The table behaves exactly as
|
|
242
|
+
* after `append`; the name is a label on the object key.
|
|
243
|
+
*/
|
|
244
|
+
appendNamed(data: Buffer, sourceName: string): void
|
|
184
245
|
/**
|
|
185
246
|
* BM25 search over one FTS column. Returns matching rows as an Arrow
|
|
186
247
|
* IPC `Buffer` (read with `tableFromIPC`). `mode` is `"or"` (default)
|
|
@@ -188,8 +249,16 @@ export declare class Table {
|
|
|
188
249
|
* `["_id", "score"]` for just id + score, or omit for full rows.
|
|
189
250
|
* `score` is a similarity (higher is better) — opposite direction
|
|
190
251
|
* from `vectorSearch`'s distance. Fuse with `hybridSearch`.
|
|
252
|
+
*
|
|
253
|
+
* `k1` / `b` override the columns' declared BM25 similarity
|
|
254
|
+
* parameters for this search only — pass both or neither. The
|
|
255
|
+
* stored score bounds belong to the declared pair, so the reader
|
|
256
|
+
* corrects them for the difference: results stay exact and only
|
|
257
|
+
* pruning power is traded, and nothing is rebuilt. A pair you mean
|
|
258
|
+
* to keep belongs on the column (`IndexSpec.fts`), where the
|
|
259
|
+
* bounds are built with it and the correction disappears.
|
|
191
260
|
*/
|
|
192
|
-
bm25Search(column: string, query: string, k: number, mode?: string | undefined | null, stats?: string | undefined | null, projection?: Array<string> | undefined | null): Buffer
|
|
261
|
+
bm25Search(column: string, query: string, k: number, mode?: string | undefined | null, stats?: string | undefined | null, projection?: Array<string> | undefined | null, k1?: number | undefined | null, b?: number | undefined | null): Buffer
|
|
193
262
|
/**
|
|
194
263
|
* Vector kNN over one vector column. `query` is a `Float32Array`
|
|
195
264
|
* (crosses by reference — no copy). Returns matching rows as an Arrow
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infino-ai/infino",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Fast search on object storage — SQL, full-text, and vector search.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"apache-arrow": "^17"
|
|
83
83
|
},
|
|
84
84
|
"optionalDependencies": {
|
|
85
|
-
"infx-darwin-x64": "0.
|
|
86
|
-
"infx-darwin-arm64": "0.
|
|
87
|
-
"infx-linux-x64-gnu": "0.
|
|
88
|
-
"infx-linux-arm64-gnu": "0.
|
|
89
|
-
"infx-linux-x64-musl": "0.
|
|
90
|
-
"infx-linux-arm64-musl": "0.
|
|
85
|
+
"infx-darwin-x64": "0.8.1",
|
|
86
|
+
"infx-darwin-arm64": "0.8.1",
|
|
87
|
+
"infx-linux-x64-gnu": "0.8.1",
|
|
88
|
+
"infx-linux-arm64-gnu": "0.8.1",
|
|
89
|
+
"infx-linux-x64-musl": "0.8.1",
|
|
90
|
+
"infx-linux-arm64-musl": "0.8.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@napi-rs/cli": "^2.18.0",
|