@infino-ai/infino 0.9.3 → 0.11.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/infino/index.d.ts +0 -14
- package/infino/index.js +23 -1
- package/infino/native.d.ts +4 -18
- package/package.json +7 -7
package/infino/index.d.ts
CHANGED
|
@@ -8,9 +8,6 @@ export declare const BUILDER_ID: string;
|
|
|
8
8
|
export type Metric = "cosine" | "l2sq" | "l2" | "negdot" | "dot";
|
|
9
9
|
/** Boolean mode for multi-term FTS queries. */
|
|
10
10
|
export type BoolMode = "or" | "and";
|
|
11
|
-
/** BM25 statistics scope: corpus-wide `"global"` IDF across superfiles
|
|
12
|
-
* (the default) or `"per_superfile"` segment-local IDF. */
|
|
13
|
-
export type Bm25Stats = "per_superfile" | "global";
|
|
14
11
|
/** A row from a query/search when not materializing to Arrow. */
|
|
15
12
|
export type RowRecord = Record<string, unknown>;
|
|
16
13
|
/** A plain `{ column: type }` schema descriptor for `createTable`. */
|
|
@@ -168,15 +165,6 @@ export interface ReindexOptions {
|
|
|
168
165
|
/** How old a sealed tombstone sidecar has to be, in milliseconds, before a
|
|
169
166
|
* rewrite takes it over. Omit to use the table's compaction setting. */
|
|
170
167
|
staleSealTimeoutMs?: number;
|
|
171
|
-
/**
|
|
172
|
-
* Credit a superfile that records no analysis revision with the one its
|
|
173
|
-
* writer emitted (default `false`). **Only sound when the table never held
|
|
174
|
-
* superfiles older than that writer**: an older compaction can have folded
|
|
175
|
-
* stale terms into a newer-stamped file, and crediting it reports the table
|
|
176
|
-
* migrated with those terms still in place. Leave unset unless the table's
|
|
177
|
-
* whole history is known.
|
|
178
|
-
*/
|
|
179
|
-
trustWriterAnalysis?: boolean;
|
|
180
168
|
}
|
|
181
169
|
/** What a `reindex` did. */
|
|
182
170
|
export interface ReindexReport {
|
|
@@ -226,8 +214,6 @@ export interface PlannedRepair {
|
|
|
226
214
|
}
|
|
227
215
|
export interface Bm25SearchOptions {
|
|
228
216
|
mode?: BoolMode;
|
|
229
|
-
/** BM25 statistics scope: `"global"` (default) or `"per_superfile"`. */
|
|
230
|
-
stats?: Bm25Stats;
|
|
231
217
|
/** Columns to return, e.g. `["_id", "score"]`; omit for full rows. */
|
|
232
218
|
projection?: string[];
|
|
233
219
|
/** BM25 `k1` for this search only, overriding the column's declared value.
|
package/infino/index.js
CHANGED
|
@@ -47,6 +47,24 @@ Object.defineProperty(exports, "IndexSpec", { enumerable: true, get: function ()
|
|
|
47
47
|
/** Infino's build identifier (version + build hash). */
|
|
48
48
|
exports.BUILDER_ID = (0, native_js_1.builderId)();
|
|
49
49
|
const STREAM = "stream";
|
|
50
|
+
// Options the engine no longer takes, with what replaces each. The addon
|
|
51
|
+
// drops unknown keys, so these throw rather than be silently ignored.
|
|
52
|
+
const REMOVED_SEARCH_OPTIONS = {
|
|
53
|
+
stats: "term search scores with table-wide statistics; prefix search and lazily loaded tables score each segment with its own",
|
|
54
|
+
};
|
|
55
|
+
const REMOVED_REINDEX_OPTIONS = {
|
|
56
|
+
trustWriterAnalysis: "every superfile records its analysis revision",
|
|
57
|
+
};
|
|
58
|
+
/** Throws a `TypeError` naming the first removed option `opts` carries. */
|
|
59
|
+
function rejectRemovedOptions(call, opts, removed) {
|
|
60
|
+
if (opts == null)
|
|
61
|
+
return;
|
|
62
|
+
for (const key of Object.keys(opts)) {
|
|
63
|
+
if (Object.hasOwn(removed, key)) {
|
|
64
|
+
throw new TypeError(`${call}: option \`${key}\` is not supported: ${removed[key]}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
50
68
|
// --- Arrow <-> IPC helpers (the boundary this layer hides) ---
|
|
51
69
|
// Rebuild an arrow type in our instance from the consumer's type. When
|
|
52
70
|
// apache-arrow is loaded as two module instances, our `makeData` can't
|
|
@@ -288,7 +306,8 @@ class Table {
|
|
|
288
306
|
guard(this.remote, () => "rows" in input ? this.inner.appendRowsNamed(input.rows, sourceName) : this.inner.appendNamed(input.ipc, sourceName));
|
|
289
307
|
}
|
|
290
308
|
bm25Search(column, query, k, opts = {}) {
|
|
291
|
-
|
|
309
|
+
rejectRemovedOptions("bm25Search", opts, REMOVED_SEARCH_OPTIONS);
|
|
310
|
+
const buf = guard(this.remote, () => this.inner.bm25Search(column, query, k, opts.mode, opts.projection, opts.k1, opts.b));
|
|
292
311
|
return decode(buf, opts.arrow);
|
|
293
312
|
}
|
|
294
313
|
vectorSearch(column, query, k, opts = {}) {
|
|
@@ -359,16 +378,19 @@ class Table {
|
|
|
359
378
|
* and `reindexPlan` / `indexStaleness` — throws with `code` `"InvalidArg"`.
|
|
360
379
|
*/
|
|
361
380
|
reindex(options) {
|
|
381
|
+
rejectRemovedOptions("reindex", options, REMOVED_REINDEX_OPTIONS);
|
|
362
382
|
return guard(this.remote, () => this.inner.reindex(options));
|
|
363
383
|
}
|
|
364
384
|
/** The superfiles {@link Table.reindex} would repair under `options`, and
|
|
365
385
|
* the repair each gets — without repairing anything. Writes nothing. */
|
|
366
386
|
reindexPlan(options) {
|
|
387
|
+
rejectRemovedOptions("reindexPlan", options, REMOVED_REINDEX_OPTIONS);
|
|
367
388
|
return guard(this.remote, () => this.inner.reindexPlan(options));
|
|
368
389
|
}
|
|
369
390
|
/** What is behind and what repairing it would cost. Writes nothing, so it is
|
|
370
391
|
* safe against a live table. */
|
|
371
392
|
indexStaleness(options) {
|
|
393
|
+
rejectRemovedOptions("indexStaleness", options, REMOVED_REINDEX_OPTIONS);
|
|
372
394
|
return guard(this.remote, () => this.inner.indexStaleness(options));
|
|
373
395
|
}
|
|
374
396
|
}
|
package/infino/native.d.ts
CHANGED
|
@@ -102,15 +102,6 @@ export interface ReindexOptions {
|
|
|
102
102
|
* rewrite takes it over. Omit to use the table's compaction setting.
|
|
103
103
|
*/
|
|
104
104
|
staleSealTimeoutMs?: number
|
|
105
|
-
/**
|
|
106
|
-
* Credit a superfile that records no analysis revision with the one its
|
|
107
|
-
* writer emitted (default `false`). **Only sound when the table never held
|
|
108
|
-
* superfiles older than that writer**: an older compaction can have folded
|
|
109
|
-
* stale terms into a newer-stamped file, and crediting it reports the
|
|
110
|
-
* table migrated with those terms still in place. Leave unset unless the
|
|
111
|
-
* table's whole history is known.
|
|
112
|
-
*/
|
|
113
|
-
trustWriterAnalysis?: boolean
|
|
114
105
|
}
|
|
115
106
|
/** What a `reindex` did. */
|
|
116
107
|
export interface ReindexReport {
|
|
@@ -183,12 +174,7 @@ export interface VectorFilter {
|
|
|
183
174
|
}
|
|
184
175
|
/** Per-column FTS options for `IndexSpec.fts`. */
|
|
185
176
|
export interface FtsOptions {
|
|
186
|
-
/**
|
|
187
|
-
* Tokenizer: `"standard"` (the default — the Unicode-aware UAX #29
|
|
188
|
-
* tokenizer that keeps non-ASCII text) or `"ascii_lower"` (ASCII
|
|
189
|
-
* split + lowercase, non-ASCII dropped). It is recorded with the
|
|
190
|
-
* table and cannot be changed afterwards.
|
|
191
|
-
*/
|
|
177
|
+
/** Base tokenizer: `"standard"`, the default, is the only one. */
|
|
192
178
|
analyzer?: string
|
|
193
179
|
/**
|
|
194
180
|
* Remove this column's stopwords — the very common words whose
|
|
@@ -272,8 +258,8 @@ export declare class IndexSpec {
|
|
|
272
258
|
constructor()
|
|
273
259
|
/**
|
|
274
260
|
* Mark `column` (a UTF-8 string column) as full-text indexed, with
|
|
275
|
-
* optional per-column `options` (
|
|
276
|
-
*
|
|
261
|
+
* optional per-column `options` (stopwords, stemmer, positions,
|
|
262
|
+
* stored, k1/b).
|
|
277
263
|
*/
|
|
278
264
|
fts(column: string, options?: FtsOptions | undefined | null): IndexSpec
|
|
279
265
|
/**
|
|
@@ -376,7 +362,7 @@ export declare class Table {
|
|
|
376
362
|
* to keep belongs on the column (`IndexSpec.fts`), where the
|
|
377
363
|
* bounds are built with it and the correction disappears.
|
|
378
364
|
*/
|
|
379
|
-
bm25Search(column: string, query: string, k: number, mode?: string | undefined | null,
|
|
365
|
+
bm25Search(column: string, query: string, k: number, mode?: string | undefined | null, projection?: Array<string> | undefined | null, k1?: number | undefined | null, b?: number | undefined | null): Buffer
|
|
380
366
|
/**
|
|
381
367
|
* Vector kNN over one vector column. `query` is a `Float32Array`
|
|
382
368
|
* (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.11.0",
|
|
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.11.0",
|
|
86
|
+
"infx-darwin-arm64": "0.11.0",
|
|
87
|
+
"infx-linux-x64-gnu": "0.11.0",
|
|
88
|
+
"infx-linux-arm64-gnu": "0.11.0",
|
|
89
|
+
"infx-linux-x64-musl": "0.11.0",
|
|
90
|
+
"infx-linux-arm64-musl": "0.11.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@napi-rs/cli": "^2.18.0",
|