@infino-ai/infino 0.8.10 → 0.9.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 +82 -0
- package/infino/index.js +25 -0
- package/infino/native.d.ts +87 -0
- package/package.json +7 -7
package/infino/index.d.ts
CHANGED
|
@@ -101,6 +101,69 @@ export interface OptimizeOptions {
|
|
|
101
101
|
* compaction still runs). Omit for `"auto"`. */
|
|
102
102
|
recalibrate?: "auto" | "force" | "skip";
|
|
103
103
|
}
|
|
104
|
+
/** How much a reindex repairs. `"auto"` gives each superfile the cheapest
|
|
105
|
+
* repair that makes it current; `"rewrite"` brings layouts current and leaves
|
|
106
|
+
* superfiles whose terms are stale (reported); `"reanalyze"` re-tokenizes every
|
|
107
|
+
* stale superfile from its stored text. */
|
|
108
|
+
export type ReindexMode = "auto" | "rewrite" | "reanalyze";
|
|
109
|
+
/** Options for `reindex`, `reindexPlan` and `indexStaleness`; all fields
|
|
110
|
+
* optional (omitted ⇒ engine default). Repairs the full-text index. */
|
|
111
|
+
export interface ReindexOptions {
|
|
112
|
+
/** How much to repair; omit for `"auto"`. */
|
|
113
|
+
mode?: ReindexMode;
|
|
114
|
+
/** How old a sealed tombstone sidecar has to be, in milliseconds, before a
|
|
115
|
+
* rewrite takes it over. Omit to use the table's compaction setting. */
|
|
116
|
+
staleSealTimeoutMs?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Credit a superfile that records no analysis revision with the one its
|
|
119
|
+
* writer emitted (default `false`). **Only sound when the table never held
|
|
120
|
+
* superfiles older than that writer**: an older compaction can have folded
|
|
121
|
+
* stale terms into a newer-stamped file, and crediting it reports the table
|
|
122
|
+
* migrated with those terms still in place. Leave unset unless the table's
|
|
123
|
+
* whole history is known.
|
|
124
|
+
*/
|
|
125
|
+
trustWriterAnalysis?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** What a `reindex` did. */
|
|
128
|
+
export interface ReindexReport {
|
|
129
|
+
/** Superfiles rewritten into the current format. */
|
|
130
|
+
rewritten: number;
|
|
131
|
+
/** Superfiles already current when the run planned. */
|
|
132
|
+
alreadyCurrent: number;
|
|
133
|
+
/** Superfiles holding terms from an older analysis that this run's mode
|
|
134
|
+
* cannot repair (non-zero only under `"rewrite"`). */
|
|
135
|
+
awaitingReanalysis: number;
|
|
136
|
+
/** Stale superfiles another run held; run again to finish them. */
|
|
137
|
+
heldByAnotherRun: number;
|
|
138
|
+
/** Columns whose text was never stored, so no repair can fix their terms;
|
|
139
|
+
* only re-ingesting them from source can. */
|
|
140
|
+
unrepairableColumns: string[];
|
|
141
|
+
}
|
|
142
|
+
/** What a `reindex` would do, and what it would cost. */
|
|
143
|
+
export interface StalenessReport {
|
|
144
|
+
/** Superfiles in the table, stale or not. */
|
|
145
|
+
superfiles: number;
|
|
146
|
+
/** Superfiles whose layout is behind — what `"rewrite"` would rewrite. */
|
|
147
|
+
needingRewrite: number;
|
|
148
|
+
/** Superfiles holding terms from an older analysis, which only
|
|
149
|
+
* re-analysis repairs. */
|
|
150
|
+
awaitingReanalysis: number;
|
|
151
|
+
/** Live bytes a `"rewrite"` would read and write again. */
|
|
152
|
+
bytesToRewrite: number;
|
|
153
|
+
/** Columns no repair can fix, because their text was never stored. */
|
|
154
|
+
unrepairableColumns: string[];
|
|
155
|
+
/** Whether a reindex would do nothing at all. */
|
|
156
|
+
isCurrent: boolean;
|
|
157
|
+
}
|
|
158
|
+
/** One superfile a `reindex` would repair, and how. */
|
|
159
|
+
export interface PlannedRepair {
|
|
160
|
+
/** The superfile the run reads and replaces. */
|
|
161
|
+
superfileId: string;
|
|
162
|
+
/** The repair it gets — never `"auto"`, which the plan has resolved. */
|
|
163
|
+
mode: Exclude<ReindexMode, "auto">;
|
|
164
|
+
/** Live bytes in the superfile. */
|
|
165
|
+
liveBytes: number;
|
|
166
|
+
}
|
|
104
167
|
export interface Bm25SearchOptions {
|
|
105
168
|
mode?: BoolMode;
|
|
106
169
|
/** BM25 statistics scope: `"global"` (default) or `"per_superfile"`. */
|
|
@@ -237,6 +300,24 @@ export declare class Table {
|
|
|
237
300
|
* calling this on a hosted connection throws.
|
|
238
301
|
*/
|
|
239
302
|
gc(graceSecs: number): GcReport;
|
|
303
|
+
/**
|
|
304
|
+
* Repair every superfile whose full-text index is behind what this engine
|
|
305
|
+
* writes. Rows, their order and their `_id`s are unchanged.
|
|
306
|
+
*
|
|
307
|
+
* Throws an Error whose message starts with `AlreadyRunningError:` while an
|
|
308
|
+
* `optimize` or another reindex holds the table — retry later.
|
|
309
|
+
*
|
|
310
|
+
* **Local durable connections only.** A `memory://` table has nothing to
|
|
311
|
+
* repair and a hosted table's storage is the service's, so on either this —
|
|
312
|
+
* and `reindexPlan` / `indexStaleness` — throws with `code` `"InvalidArg"`.
|
|
313
|
+
*/
|
|
314
|
+
reindex(options?: ReindexOptions): ReindexReport;
|
|
315
|
+
/** The superfiles {@link Table.reindex} would repair under `options`, and
|
|
316
|
+
* the repair each gets — without repairing anything. Writes nothing. */
|
|
317
|
+
reindexPlan(options?: ReindexOptions): PlannedRepair[];
|
|
318
|
+
/** What is behind and what repairing it would cost. Writes nothing, so it is
|
|
319
|
+
* safe against a live table. */
|
|
320
|
+
indexStaleness(options?: ReindexOptions): StalenessReport;
|
|
240
321
|
}
|
|
241
322
|
/** A catalog connection. Create one with {@link connect}. */
|
|
242
323
|
export declare class Connection {
|
|
@@ -253,6 +334,7 @@ export declare class Connection {
|
|
|
253
334
|
/** Create a table from an apache-arrow `Schema` or `{ column: type }`. */
|
|
254
335
|
createTable(name: string, schema: arrow.Schema | SchemaDescriptor | Buffer, indexes: IndexSpec): Table;
|
|
255
336
|
openTable(name: string): Table;
|
|
337
|
+
/** Drop a table. `purge` defaults to `true`, which also deletes the table's storage; pass `false` to only unregister it and keep the bytes. */
|
|
256
338
|
dropTable(name: string, purge?: boolean): void;
|
|
257
339
|
listTables(): string[];
|
|
258
340
|
/** SQL across the catalog; rows as records (or an Arrow `Table`). */
|
package/infino/index.js
CHANGED
|
@@ -322,6 +322,30 @@ class Table {
|
|
|
322
322
|
gc(graceSecs) {
|
|
323
323
|
return guard(this.remote, () => this.inner.gc(graceSecs));
|
|
324
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Repair every superfile whose full-text index is behind what this engine
|
|
327
|
+
* writes. Rows, their order and their `_id`s are unchanged.
|
|
328
|
+
*
|
|
329
|
+
* Throws an Error whose message starts with `AlreadyRunningError:` while an
|
|
330
|
+
* `optimize` or another reindex holds the table — retry later.
|
|
331
|
+
*
|
|
332
|
+
* **Local durable connections only.** A `memory://` table has nothing to
|
|
333
|
+
* repair and a hosted table's storage is the service's, so on either this —
|
|
334
|
+
* and `reindexPlan` / `indexStaleness` — throws with `code` `"InvalidArg"`.
|
|
335
|
+
*/
|
|
336
|
+
reindex(options) {
|
|
337
|
+
return guard(this.remote, () => this.inner.reindex(options));
|
|
338
|
+
}
|
|
339
|
+
/** The superfiles {@link Table.reindex} would repair under `options`, and
|
|
340
|
+
* the repair each gets — without repairing anything. Writes nothing. */
|
|
341
|
+
reindexPlan(options) {
|
|
342
|
+
return guard(this.remote, () => this.inner.reindexPlan(options));
|
|
343
|
+
}
|
|
344
|
+
/** What is behind and what repairing it would cost. Writes nothing, so it is
|
|
345
|
+
* safe against a live table. */
|
|
346
|
+
indexStaleness(options) {
|
|
347
|
+
return guard(this.remote, () => this.inner.indexStaleness(options));
|
|
348
|
+
}
|
|
325
349
|
}
|
|
326
350
|
exports.Table = Table;
|
|
327
351
|
/** A catalog connection. Create one with {@link connect}. */
|
|
@@ -349,6 +373,7 @@ class Connection {
|
|
|
349
373
|
openTable(name) {
|
|
350
374
|
return new Table(guard(this.remote, () => this.inner.openTable(name)), this.remote);
|
|
351
375
|
}
|
|
376
|
+
/** Drop a table. `purge` defaults to `true`, which also deletes the table's storage; pass `false` to only unregister it and keep the bytes. */
|
|
352
377
|
dropTable(name, purge) {
|
|
353
378
|
guard(this.remote, () => this.inner.dropTable(name, purge));
|
|
354
379
|
}
|
package/infino/native.d.ts
CHANGED
|
@@ -84,6 +84,80 @@ export interface GcReport {
|
|
|
84
84
|
/** Objects that failed to delete (left for the next sweep). */
|
|
85
85
|
deleteErrors: number
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Options for `reindex`, `reindexPlan` and `indexStaleness`; all fields
|
|
89
|
+
* optional (omitted ⇒ engine default). Repairs the full-text index, the only
|
|
90
|
+
* index with a repair today.
|
|
91
|
+
*/
|
|
92
|
+
export interface ReindexOptions {
|
|
93
|
+
/**
|
|
94
|
+
* How much to repair: `"auto"` (default — the cheapest repair that makes
|
|
95
|
+
* each superfile current), `"rewrite"` (layout only; superfiles whose
|
|
96
|
+
* terms are stale are left and reported), or `"reanalyze"` (re-tokenize
|
|
97
|
+
* every stale superfile from its stored text).
|
|
98
|
+
*/
|
|
99
|
+
mode?: string
|
|
100
|
+
/**
|
|
101
|
+
* How old a sealed tombstone sidecar has to be, in milliseconds, before a
|
|
102
|
+
* rewrite takes it over. Omit to use the table's compaction setting.
|
|
103
|
+
*/
|
|
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
|
+
}
|
|
115
|
+
/** What a `reindex` did. */
|
|
116
|
+
export interface ReindexReport {
|
|
117
|
+
/** Superfiles rewritten into the current format. */
|
|
118
|
+
rewritten: number
|
|
119
|
+
/** Superfiles already current when the run planned. */
|
|
120
|
+
alreadyCurrent: number
|
|
121
|
+
/**
|
|
122
|
+
* Superfiles holding terms from an older analysis that this run's mode
|
|
123
|
+
* cannot repair (non-zero only under `"rewrite"`).
|
|
124
|
+
*/
|
|
125
|
+
awaitingReanalysis: number
|
|
126
|
+
/** Stale superfiles another run held; run again to finish them. */
|
|
127
|
+
heldByAnotherRun: number
|
|
128
|
+
/**
|
|
129
|
+
* Columns whose text was never stored, so no repair can fix their terms;
|
|
130
|
+
* only re-ingesting them from source can.
|
|
131
|
+
*/
|
|
132
|
+
unrepairableColumns: Array<string>
|
|
133
|
+
}
|
|
134
|
+
/** What a `reindex` would do, and what it would cost. */
|
|
135
|
+
export interface StalenessReport {
|
|
136
|
+
/** Superfiles in the table, stale or not. */
|
|
137
|
+
superfiles: number
|
|
138
|
+
/** Superfiles whose layout is behind — what `"rewrite"` would rewrite. */
|
|
139
|
+
needingRewrite: number
|
|
140
|
+
/**
|
|
141
|
+
* Superfiles holding terms from an older analysis, which only
|
|
142
|
+
* re-analysis repairs.
|
|
143
|
+
*/
|
|
144
|
+
awaitingReanalysis: number
|
|
145
|
+
/** Live bytes a `"rewrite"` would read and write again. */
|
|
146
|
+
bytesToRewrite: number
|
|
147
|
+
/** Columns no repair can fix, because their text was never stored. */
|
|
148
|
+
unrepairableColumns: Array<string>
|
|
149
|
+
/** Whether a reindex would do nothing at all. */
|
|
150
|
+
isCurrent: boolean
|
|
151
|
+
}
|
|
152
|
+
/** One superfile a `reindex` would repair, and how. */
|
|
153
|
+
export interface PlannedRepair {
|
|
154
|
+
/** The superfile the run reads and replaces. */
|
|
155
|
+
superfileId: string
|
|
156
|
+
/** The repair it gets: `"rewrite"` or `"reanalyze"`, never `"auto"`. */
|
|
157
|
+
mode: string
|
|
158
|
+
/** Live bytes in the superfile. */
|
|
159
|
+
liveBytes: number
|
|
160
|
+
}
|
|
87
161
|
/**
|
|
88
162
|
* Text-predicate filter for `vectorSearch` — a pushdown pre-filter, not a
|
|
89
163
|
* post-filter: kNN ranks only among rows whose FTS-indexed `column` matches
|
|
@@ -327,6 +401,19 @@ export declare class Table {
|
|
|
327
401
|
* racing readers/writers) are removed. Requires durable storage.
|
|
328
402
|
*/
|
|
329
403
|
gc(graceSecs: number): GcReport
|
|
404
|
+
/**
|
|
405
|
+
* Repair every superfile whose full-text index is behind what this engine
|
|
406
|
+
* writes. Rows, their order and their `_id`s are unchanged. Requires
|
|
407
|
+
* durable storage and takes the table's compaction slot.
|
|
408
|
+
*/
|
|
409
|
+
reindex(options?: ReindexOptions | undefined | null): ReindexReport
|
|
410
|
+
/**
|
|
411
|
+
* The superfiles `reindex` would repair under `options`, and the repair
|
|
412
|
+
* each gets — without repairing anything. Writes nothing.
|
|
413
|
+
*/
|
|
414
|
+
reindexPlan(options?: ReindexOptions | undefined | null): Array<PlannedRepair>
|
|
415
|
+
/** What is behind and what repairing it would cost. Writes nothing. */
|
|
416
|
+
indexStaleness(options?: ReindexOptions | undefined | null): StalenessReport
|
|
330
417
|
/**
|
|
331
418
|
* The user-facing Arrow schema, as an Arrow IPC `Buffer` (an empty
|
|
332
419
|
* table carrying the schema; read with `tableFromIPC`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infino-ai/infino",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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.9.0",
|
|
86
|
+
"infx-darwin-arm64": "0.9.0",
|
|
87
|
+
"infx-linux-x64-gnu": "0.9.0",
|
|
88
|
+
"infx-linux-arm64-gnu": "0.9.0",
|
|
89
|
+
"infx-linux-x64-musl": "0.9.0",
|
|
90
|
+
"infx-linux-arm64-musl": "0.9.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@napi-rs/cli": "^2.18.0",
|