@dengxifeng/lancedb 0.26.2

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.
Files changed (43) hide show
  1. package/AGENTS.md +13 -0
  2. package/CONTRIBUTING.md +76 -0
  3. package/README.md +37 -0
  4. package/dist/arrow.d.ts +279 -0
  5. package/dist/arrow.js +1316 -0
  6. package/dist/connection.d.ts +259 -0
  7. package/dist/connection.js +224 -0
  8. package/dist/embedding/embedding_function.d.ts +103 -0
  9. package/dist/embedding/embedding_function.js +192 -0
  10. package/dist/embedding/index.d.ts +27 -0
  11. package/dist/embedding/index.js +101 -0
  12. package/dist/embedding/openai.d.ts +16 -0
  13. package/dist/embedding/openai.js +93 -0
  14. package/dist/embedding/registry.d.ts +74 -0
  15. package/dist/embedding/registry.js +165 -0
  16. package/dist/embedding/transformers.d.ts +36 -0
  17. package/dist/embedding/transformers.js +122 -0
  18. package/dist/header.d.ts +162 -0
  19. package/dist/header.js +217 -0
  20. package/dist/index.d.ts +85 -0
  21. package/dist/index.js +106 -0
  22. package/dist/indices.d.ts +692 -0
  23. package/dist/indices.js +156 -0
  24. package/dist/merge.d.ts +80 -0
  25. package/dist/merge.js +92 -0
  26. package/dist/native.d.ts +585 -0
  27. package/dist/native.js +339 -0
  28. package/dist/permutation.d.ts +143 -0
  29. package/dist/permutation.js +184 -0
  30. package/dist/query.d.ts +581 -0
  31. package/dist/query.js +853 -0
  32. package/dist/rerankers/index.d.ts +5 -0
  33. package/dist/rerankers/index.js +19 -0
  34. package/dist/rerankers/rrf.d.ts +14 -0
  35. package/dist/rerankers/rrf.js +28 -0
  36. package/dist/sanitize.d.ts +32 -0
  37. package/dist/sanitize.js +473 -0
  38. package/dist/table.d.ts +581 -0
  39. package/dist/table.js +321 -0
  40. package/dist/util.d.ts +14 -0
  41. package/dist/util.js +77 -0
  42. package/license_header.txt +2 -0
  43. package/package.json +122 -0
@@ -0,0 +1,581 @@
1
+ import { Table as ArrowTable, type IntoVector, RecordBatch } from "./arrow";
2
+ import { type IvfPqOptions } from "./indices";
3
+ import { JsFullTextQuery, RecordBatchIterator as NativeBatchIterator, Query as NativeQuery, Table as NativeTable, TakeQuery as NativeTakeQuery, VectorQuery as NativeVectorQuery } from "./native";
4
+ import { Reranker } from "./rerankers";
5
+ export declare function RecordBatchIterator(promisedInner: Promise<NativeBatchIterator>): AsyncGenerator<RecordBatch<any>, void, unknown>;
6
+ /**
7
+ * Options that control the behavior of a particular query execution
8
+ */
9
+ export interface QueryExecutionOptions {
10
+ /**
11
+ * The maximum number of rows to return in a single batch
12
+ *
13
+ * Batches may have fewer rows if the underlying data is stored
14
+ * in smaller chunks.
15
+ */
16
+ maxBatchLength?: number;
17
+ /**
18
+ * Timeout for query execution in milliseconds
19
+ */
20
+ timeoutMs?: number;
21
+ }
22
+ /**
23
+ * Options that control the behavior of a full text search
24
+ */
25
+ export interface FullTextSearchOptions {
26
+ /**
27
+ * The columns to search
28
+ *
29
+ * If not specified, all indexed columns will be searched.
30
+ * For now, only one column can be searched.
31
+ */
32
+ columns?: string | string[];
33
+ }
34
+ /** Common methods supported by all query types
35
+ *
36
+ * @see {@link Query}
37
+ * @see {@link VectorQuery}
38
+ *
39
+ * @hideconstructor
40
+ */
41
+ export declare class QueryBase<NativeQueryType extends NativeQuery | NativeVectorQuery | NativeTakeQuery> implements AsyncIterable<RecordBatch> {
42
+ protected inner: NativeQueryType | Promise<NativeQueryType>;
43
+ /**
44
+ * @hidden
45
+ */
46
+ protected constructor(inner: NativeQueryType | Promise<NativeQueryType>);
47
+ /**
48
+ * @hidden
49
+ */
50
+ protected doCall(fn: (inner: NativeQueryType) => void): void;
51
+ /**
52
+ * Return only the specified columns.
53
+ *
54
+ * By default a query will return all columns from the table. However, this can have
55
+ * a very significant impact on latency. LanceDb stores data in a columnar fashion. This
56
+ * means we can finely tune our I/O to select exactly the columns we need.
57
+ *
58
+ * As a best practice you should always limit queries to the columns that you need. If you
59
+ * pass in an array of column names then only those columns will be returned.
60
+ *
61
+ * You can also use this method to create new "dynamic" columns based on your existing columns.
62
+ * For example, you may not care about "a" or "b" but instead simply want "a + b". This is often
63
+ * seen in the SELECT clause of an SQL query (e.g. `SELECT a+b FROM my_table`).
64
+ *
65
+ * To create dynamic columns you can pass in a Map<string, string>. A column will be returned
66
+ * for each entry in the map. The key provides the name of the column. The value is
67
+ * an SQL string used to specify how the column is calculated.
68
+ *
69
+ * For example, an SQL query might state `SELECT a + b AS combined, c`. The equivalent
70
+ * input to this method would be:
71
+ * @example
72
+ * new Map([["combined", "a + b"], ["c", "c"]])
73
+ *
74
+ * Columns will always be returned in the order given, even if that order is different than
75
+ * the order used when adding the data.
76
+ *
77
+ * Note that you can pass in a `Record<string, string>` (e.g. an object literal). This method
78
+ * uses `Object.entries` which should preserve the insertion order of the object. However,
79
+ * object insertion order is easy to get wrong and `Map` is more foolproof.
80
+ */
81
+ select(columns: string[] | Map<string, string> | Record<string, string> | string): this;
82
+ /**
83
+ * Whether to return the row id in the results.
84
+ *
85
+ * This column can be used to match results between different queries. For
86
+ * example, to match results from a full text search and a vector search in
87
+ * order to perform hybrid search.
88
+ */
89
+ withRowId(): this;
90
+ /**
91
+ * @hidden
92
+ */
93
+ protected nativeExecute(options?: Partial<QueryExecutionOptions>): Promise<NativeBatchIterator>;
94
+ /**
95
+ * Execute the query and return the results as an @see {@link AsyncIterator}
96
+ * of @see {@link RecordBatch}.
97
+ *
98
+ * By default, LanceDb will use many threads to calculate results and, when
99
+ * the result set is large, multiple batches will be processed at one time.
100
+ * This readahead is limited however and backpressure will be applied if this
101
+ * stream is consumed slowly (this constrains the maximum memory used by a
102
+ * single query)
103
+ *
104
+ */
105
+ protected execute(options?: Partial<QueryExecutionOptions>): AsyncGenerator<RecordBatch<any>, void, unknown>;
106
+ /**
107
+ * @hidden
108
+ */
109
+ [Symbol.asyncIterator](): AsyncIterator<RecordBatch<any>>;
110
+ /** Collect the results as an Arrow @see {@link ArrowTable}. */
111
+ toArrow(options?: Partial<QueryExecutionOptions>): Promise<ArrowTable>;
112
+ /** Collect the results as an array of objects. */
113
+ toArray(options?: Partial<QueryExecutionOptions>): Promise<any[]>;
114
+ /**
115
+ * Generates an explanation of the query execution plan.
116
+ *
117
+ * @example
118
+ * import * as lancedb from "@lancedb/lancedb"
119
+ * const db = await lancedb.connect("./.lancedb");
120
+ * const table = await db.createTable("my_table", [
121
+ * { vector: [1.1, 0.9], id: "1" },
122
+ * ]);
123
+ * const plan = await table.query().nearestTo([0.5, 0.2]).explainPlan();
124
+ *
125
+ * @param verbose - If true, provides a more detailed explanation. Defaults to false.
126
+ * @returns A Promise that resolves to a string containing the query execution plan explanation.
127
+ */
128
+ explainPlan(verbose?: boolean): Promise<string>;
129
+ /**
130
+ * Executes the query and returns the physical query plan annotated with runtime metrics.
131
+ *
132
+ * This is useful for debugging and performance analysis, as it shows how the query was executed
133
+ * and includes metrics such as elapsed time, rows processed, and I/O statistics.
134
+ *
135
+ * @example
136
+ * import * as lancedb from "@lancedb/lancedb"
137
+ *
138
+ * const db = await lancedb.connect("./.lancedb");
139
+ * const table = await db.createTable("my_table", [
140
+ * { vector: [1.1, 0.9], id: "1" },
141
+ * ]);
142
+ *
143
+ * const plan = await table.query().nearestTo([0.5, 0.2]).analyzePlan();
144
+ *
145
+ * Example output (with runtime metrics inlined):
146
+ * AnalyzeExec verbose=true, metrics=[]
147
+ * ProjectionExec: expr=[id@3 as id, vector@0 as vector, _distance@2 as _distance], metrics=[output_rows=1, elapsed_compute=3.292µs]
148
+ * Take: columns="vector, _rowid, _distance, (id)", metrics=[output_rows=1, elapsed_compute=66.001µs, batches_processed=1, bytes_read=8, iops=1, requests=1]
149
+ * CoalesceBatchesExec: target_batch_size=1024, metrics=[output_rows=1, elapsed_compute=3.333µs]
150
+ * GlobalLimitExec: skip=0, fetch=10, metrics=[output_rows=1, elapsed_compute=167ns]
151
+ * FilterExec: _distance@2 IS NOT NULL, metrics=[output_rows=1, elapsed_compute=8.542µs]
152
+ * SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], metrics=[output_rows=1, elapsed_compute=63.25µs, row_replacements=1]
153
+ * KNNVectorDistance: metric=l2, metrics=[output_rows=1, elapsed_compute=114.333µs, output_batches=1]
154
+ * LanceScan: uri=/path/to/data, projection=[vector], row_id=true, row_addr=false, ordered=false, metrics=[output_rows=1, elapsed_compute=103.626µs, bytes_read=549, iops=2, requests=2]
155
+ *
156
+ * @returns A query execution plan with runtime metrics for each step.
157
+ */
158
+ analyzePlan(): Promise<string>;
159
+ /**
160
+ * Returns the schema of the output that will be returned by this query.
161
+ *
162
+ * This can be used to inspect the types and names of the columns that will be
163
+ * returned by the query before executing it.
164
+ *
165
+ * @returns An Arrow Schema describing the output columns.
166
+ */
167
+ outputSchema(): Promise<import("./arrow").Schema>;
168
+ }
169
+ export declare class StandardQueryBase<NativeQueryType extends NativeQuery | NativeVectorQuery> extends QueryBase<NativeQueryType> implements ExecutableQuery {
170
+ constructor(inner: NativeQueryType | Promise<NativeQueryType>);
171
+ /**
172
+ * A filter statement to be applied to this query.
173
+ *
174
+ * The filter should be supplied as an SQL query string. For example:
175
+ * @example
176
+ * x > 10
177
+ * y > 0 AND y < 100
178
+ * x > 5 OR y = 'test'
179
+ *
180
+ * Filtering performance can often be improved by creating a scalar index
181
+ * on the filter column(s).
182
+ */
183
+ where(predicate: string): this;
184
+ /**
185
+ * A filter statement to be applied to this query.
186
+ * @see where
187
+ * @deprecated Use `where` instead
188
+ */
189
+ filter(predicate: string): this;
190
+ fullTextSearch(query: string | FullTextQuery, options?: Partial<FullTextSearchOptions>): this;
191
+ /**
192
+ * Set the maximum number of results to return.
193
+ *
194
+ * By default, a plain search has no limit. If this method is not
195
+ * called then every valid row from the table will be returned.
196
+ */
197
+ limit(limit: number): this;
198
+ /**
199
+ * Set the number of rows to skip before returning results.
200
+ *
201
+ * This is useful for pagination.
202
+ */
203
+ offset(offset: number): this;
204
+ /**
205
+ * Skip searching un-indexed data. This can make search faster, but will miss
206
+ * any data that is not yet indexed.
207
+ *
208
+ * Use {@link Table#optimize} to index all un-indexed data.
209
+ */
210
+ fastSearch(): this;
211
+ }
212
+ /**
213
+ * An interface for a query that can be executed
214
+ *
215
+ * Supported by all query types
216
+ */
217
+ export interface ExecutableQuery {
218
+ }
219
+ /**
220
+ * A builder used to construct a vector search
221
+ *
222
+ * This builder can be reused to execute the query many times.
223
+ *
224
+ * @see {@link Query#nearestTo}
225
+ *
226
+ * @hideconstructor
227
+ */
228
+ export declare class VectorQuery extends StandardQueryBase<NativeVectorQuery> {
229
+ /**
230
+ * @hidden
231
+ */
232
+ constructor(inner: NativeVectorQuery | Promise<NativeVectorQuery>);
233
+ /**
234
+ * Set the number of partitions to search (probe)
235
+ *
236
+ * This argument is only used when the vector column has an IVF PQ index.
237
+ * If there is no index then this value is ignored.
238
+ *
239
+ * The IVF stage of IVF PQ divides the input into partitions (clusters) of
240
+ * related values.
241
+ *
242
+ * The partition whose centroids are closest to the query vector will be
243
+ * exhaustiely searched to find matches. This parameter controls how many
244
+ * partitions should be searched.
245
+ *
246
+ * Increasing this value will increase the recall of your query but will
247
+ * also increase the latency of your query. The default value is 20. This
248
+ * default is good for many cases but the best value to use will depend on
249
+ * your data and the recall that you need to achieve.
250
+ *
251
+ * For best results we recommend tuning this parameter with a benchmark against
252
+ * your actual data to find the smallest possible value that will still give
253
+ * you the desired recall.
254
+ *
255
+ * For more fine grained control over behavior when you have a very narrow filter
256
+ * you can use `minimumNprobes` and `maximumNprobes`. This method sets both
257
+ * the minimum and maximum to the same value.
258
+ */
259
+ nprobes(nprobes: number): VectorQuery;
260
+ /**
261
+ * Set the minimum number of probes used.
262
+ *
263
+ * This controls the minimum number of partitions that will be searched. This
264
+ * parameter will impact every query against a vector index, regardless of the
265
+ * filter. See `nprobes` for more details. Higher values will increase recall
266
+ * but will also increase latency.
267
+ */
268
+ minimumNprobes(minimumNprobes: number): VectorQuery;
269
+ /**
270
+ * Set the maximum number of probes used.
271
+ *
272
+ * This controls the maximum number of partitions that will be searched. If this
273
+ * number is greater than minimumNprobes then the excess partitions will _only_ be
274
+ * searched if we have not found enough results. This can be useful when there is
275
+ * a narrow filter to allow these queries to spend more time searching and avoid
276
+ * potential false negatives.
277
+ */
278
+ maximumNprobes(maximumNprobes: number): VectorQuery;
279
+ distanceRange(lowerBound?: number, upperBound?: number): VectorQuery;
280
+ /**
281
+ * Set the number of candidates to consider during the search
282
+ *
283
+ * This argument is only used when the vector column has an HNSW index.
284
+ * If there is no index then this value is ignored.
285
+ *
286
+ * Increasing this value will increase the recall of your query but will
287
+ * also increase the latency of your query. The default value is 1.5*limit.
288
+ */
289
+ ef(ef: number): VectorQuery;
290
+ /**
291
+ * Set the vector column to query
292
+ *
293
+ * This controls which column is compared to the query vector supplied in
294
+ * the call to @see {@link Query#nearestTo}
295
+ *
296
+ * This parameter must be specified if the table has more than one column
297
+ * whose data type is a fixed-size-list of floats.
298
+ */
299
+ column(column: string): VectorQuery;
300
+ /**
301
+ * Set the distance metric to use
302
+ *
303
+ * When performing a vector search we try and find the "nearest" vectors according
304
+ * to some kind of distance metric. This parameter controls which distance metric to
305
+ * use. See @see {@link IvfPqOptions.distanceType} for more details on the different
306
+ * distance metrics available.
307
+ *
308
+ * Note: if there is a vector index then the distance type used MUST match the distance
309
+ * type used to train the vector index. If this is not done then the results will be
310
+ * invalid.
311
+ *
312
+ * By default "l2" is used.
313
+ */
314
+ distanceType(distanceType: Required<IvfPqOptions>["distanceType"]): VectorQuery;
315
+ /**
316
+ * A multiplier to control how many additional rows are taken during the refine step
317
+ *
318
+ * This argument is only used when the vector column has an IVF PQ index.
319
+ * If there is no index then this value is ignored.
320
+ *
321
+ * An IVF PQ index stores compressed (quantized) values. They query vector is compared
322
+ * against these values and, since they are compressed, the comparison is inaccurate.
323
+ *
324
+ * This parameter can be used to refine the results. It can improve both improve recall
325
+ * and correct the ordering of the nearest results.
326
+ *
327
+ * To refine results LanceDb will first perform an ANN search to find the nearest
328
+ * `limit` * `refine_factor` results. In other words, if `refine_factor` is 3 and
329
+ * `limit` is the default (10) then the first 30 results will be selected. LanceDb
330
+ * then fetches the full, uncompressed, values for these 30 results. The results are
331
+ * then reordered by the true distance and only the nearest 10 are kept.
332
+ *
333
+ * Note: there is a difference between calling this method with a value of 1 and never
334
+ * calling this method at all. Calling this method with any value will have an impact
335
+ * on your search latency. When you call this method with a `refine_factor` of 1 then
336
+ * LanceDb still needs to fetch the full, uncompressed, values so that it can potentially
337
+ * reorder the results.
338
+ *
339
+ * Note: if this method is NOT called then the distances returned in the _distance column
340
+ * will be approximate distances based on the comparison of the quantized query vector
341
+ * and the quantized result vectors. This can be considerably different than the true
342
+ * distance between the query vector and the actual uncompressed vector.
343
+ */
344
+ refineFactor(refineFactor: number): VectorQuery;
345
+ /**
346
+ * If this is called then filtering will happen after the vector search instead of
347
+ * before.
348
+ *
349
+ * By default filtering will be performed before the vector search. This is how
350
+ * filtering is typically understood to work. This prefilter step does add some
351
+ * additional latency. Creating a scalar index on the filter column(s) can
352
+ * often improve this latency. However, sometimes a filter is too complex or scalar
353
+ * indices cannot be applied to the column. In these cases postfiltering can be
354
+ * used instead of prefiltering to improve latency.
355
+ *
356
+ * Post filtering applies the filter to the results of the vector search. This means
357
+ * we only run the filter on a much smaller set of data. However, it can cause the
358
+ * query to return fewer than `limit` results (or even no results) if none of the nearest
359
+ * results match the filter.
360
+ *
361
+ * Post filtering happens during the "refine stage" (described in more detail in
362
+ * @see {@link VectorQuery#refineFactor}). This means that setting a higher refine
363
+ * factor can often help restore some of the results lost by post filtering.
364
+ */
365
+ postfilter(): VectorQuery;
366
+ /**
367
+ * If this is called then any vector index is skipped
368
+ *
369
+ * An exhaustive (flat) search will be performed. The query vector will
370
+ * be compared to every vector in the table. At high scales this can be
371
+ * expensive. However, this is often still useful. For example, skipping
372
+ * the vector index can give you ground truth results which you can use to
373
+ * calculate your recall to select an appropriate value for nprobes.
374
+ */
375
+ bypassVectorIndex(): VectorQuery;
376
+ addQueryVector(vector: IntoVector): VectorQuery;
377
+ rerank(reranker: Reranker): VectorQuery;
378
+ }
379
+ /**
380
+ * A query that returns a subset of the rows in the table.
381
+ *
382
+ * @hideconstructor
383
+ */
384
+ export declare class TakeQuery extends QueryBase<NativeTakeQuery> {
385
+ constructor(inner: NativeTakeQuery);
386
+ }
387
+ /** A builder for LanceDB queries.
388
+ *
389
+ * @see {@link Table#query}, {@link Table#search}
390
+ *
391
+ * @hideconstructor
392
+ */
393
+ export declare class Query extends StandardQueryBase<NativeQuery> {
394
+ /**
395
+ * @hidden
396
+ */
397
+ constructor(tbl: NativeTable);
398
+ /**
399
+ * Find the nearest vectors to the given query vector.
400
+ *
401
+ * This converts the query from a plain query to a vector query.
402
+ *
403
+ * This method will attempt to convert the input to the query vector
404
+ * expected by the embedding model. If the input cannot be converted
405
+ * then an error will be thrown.
406
+ *
407
+ * By default, there is no embedding model, and the input should be
408
+ * an array-like object of numbers (something that can be used as input
409
+ * to Float32Array.from)
410
+ *
411
+ * If there is only one vector column (a column whose data type is a
412
+ * fixed size list of floats) then the column does not need to be specified.
413
+ * If there is more than one vector column you must use
414
+ * @see {@link VectorQuery#column} to specify which column you would like
415
+ * to compare with.
416
+ *
417
+ * If no index has been created on the vector column then a vector query
418
+ * will perform a distance comparison between the query vector and every
419
+ * vector in the database and then sort the results. This is sometimes
420
+ * called a "flat search"
421
+ *
422
+ * For small databases, with a few hundred thousand vectors or less, this can
423
+ * be reasonably fast. In larger databases you should create a vector index
424
+ * on the column. If there is a vector index then an "approximate" nearest
425
+ * neighbor search (frequently called an ANN search) will be performed. This
426
+ * search is much faster, but the results will be approximate.
427
+ *
428
+ * The query can be further parameterized using the returned builder. There
429
+ * are various ANN search parameters that will let you fine tune your recall
430
+ * accuracy vs search latency.
431
+ *
432
+ * Vector searches always have a `limit`. If `limit` has not been called then
433
+ * a default `limit` of 10 will be used. @see {@link Query#limit}
434
+ */
435
+ nearestTo(vector: IntoVector): VectorQuery;
436
+ nearestToText(query: string | FullTextQuery, columns?: string[]): Query;
437
+ }
438
+ /**
439
+ * Enum representing the types of full-text queries supported.
440
+ *
441
+ * - `Match`: Performs a full-text search for terms in the query string.
442
+ * - `MatchPhrase`: Searches for an exact phrase match in the text.
443
+ * - `Boost`: Boosts the relevance score of specific terms in the query.
444
+ * - `MultiMatch`: Searches across multiple fields for the query terms.
445
+ */
446
+ export declare enum FullTextQueryType {
447
+ Match = "match",
448
+ MatchPhrase = "match_phrase",
449
+ Boost = "boost",
450
+ MultiMatch = "multi_match",
451
+ Boolean = "boolean"
452
+ }
453
+ /**
454
+ * Enum representing the logical operators used in full-text queries.
455
+ *
456
+ * - `And`: All terms must match.
457
+ * - `Or`: At least one term must match.
458
+ */
459
+ export declare enum Operator {
460
+ And = "AND",
461
+ Or = "OR"
462
+ }
463
+ /**
464
+ * Enum representing the occurrence of terms in full-text queries.
465
+ *
466
+ * - `Must`: The term must be present in the document.
467
+ * - `Should`: The term should contribute to the document score, but is not required.
468
+ * - `MustNot`: The term must not be present in the document.
469
+ */
470
+ export declare enum Occur {
471
+ Should = "SHOULD",
472
+ Must = "MUST",
473
+ MustNot = "MUST_NOT"
474
+ }
475
+ /**
476
+ * Represents a full-text query interface.
477
+ * This interface defines the structure and behavior for full-text queries,
478
+ * including methods to retrieve the query type and convert the query to a dictionary format.
479
+ */
480
+ export interface FullTextQuery {
481
+ /**
482
+ * Returns the inner query object.
483
+ * This is the underlying query object used by the database engine.
484
+ * @ignore
485
+ */
486
+ inner: JsFullTextQuery;
487
+ /**
488
+ * The type of the full-text query.
489
+ */
490
+ queryType(): FullTextQueryType;
491
+ }
492
+ export declare function instanceOfFullTextQuery(obj: any): obj is FullTextQuery;
493
+ export declare class MatchQuery implements FullTextQuery {
494
+ /** @ignore */
495
+ readonly inner: JsFullTextQuery;
496
+ /**
497
+ * Creates an instance of MatchQuery.
498
+ *
499
+ * @param query - The text query to search for.
500
+ * @param column - The name of the column to search within.
501
+ * @param options - Optional parameters for the match query.
502
+ * - `boost`: The boost factor for the query (default is 1.0).
503
+ * - `fuzziness`: The fuzziness level for the query (default is 0).
504
+ * - `maxExpansions`: The maximum number of terms to consider for fuzzy matching (default is 50).
505
+ * - `operator`: The logical operator to use for combining terms in the query (default is "OR").
506
+ * - `prefixLength`: The number of beginning characters being unchanged for fuzzy matching.
507
+ */
508
+ constructor(query: string, column: string, options?: {
509
+ boost?: number;
510
+ fuzziness?: number;
511
+ maxExpansions?: number;
512
+ operator?: Operator;
513
+ prefixLength?: number;
514
+ });
515
+ queryType(): FullTextQueryType;
516
+ }
517
+ export declare class PhraseQuery implements FullTextQuery {
518
+ /** @ignore */
519
+ readonly inner: JsFullTextQuery;
520
+ /**
521
+ * Creates an instance of `PhraseQuery`.
522
+ *
523
+ * @param query - The phrase to search for in the specified column.
524
+ * @param column - The name of the column to search within.
525
+ * @param options - Optional parameters for the phrase query.
526
+ * - `slop`: The maximum number of intervening unmatched positions allowed between words in the phrase (default is 0).
527
+ */
528
+ constructor(query: string, column: string, options?: {
529
+ slop?: number;
530
+ });
531
+ queryType(): FullTextQueryType;
532
+ }
533
+ export declare class BoostQuery implements FullTextQuery {
534
+ /** @ignore */
535
+ readonly inner: JsFullTextQuery;
536
+ /**
537
+ * Creates an instance of BoostQuery.
538
+ * The boost returns documents that match the positive query,
539
+ * but penalizes those that match the negative query.
540
+ * the penalty is controlled by the `negativeBoost` parameter.
541
+ *
542
+ * @param positive - The positive query that boosts the relevance score.
543
+ * @param negative - The negative query that reduces the relevance score.
544
+ * @param options - Optional parameters for the boost query.
545
+ * - `negativeBoost`: The boost factor for the negative query (default is 0.0).
546
+ */
547
+ constructor(positive: FullTextQuery, negative: FullTextQuery, options?: {
548
+ negativeBoost?: number;
549
+ });
550
+ queryType(): FullTextQueryType;
551
+ }
552
+ export declare class MultiMatchQuery implements FullTextQuery {
553
+ /** @ignore */
554
+ readonly inner: JsFullTextQuery;
555
+ /**
556
+ * Creates an instance of MultiMatchQuery.
557
+ *
558
+ * @param query - The text query to search for across multiple columns.
559
+ * @param columns - An array of column names to search within.
560
+ * @param options - Optional parameters for the multi-match query.
561
+ * - `boosts`: An array of boost factors for each column (default is 1.0 for all).
562
+ * - `operator`: The logical operator to use for combining terms in the query (default is "OR").
563
+ */
564
+ constructor(query: string, columns: string[], options?: {
565
+ boosts?: number[];
566
+ operator?: Operator;
567
+ });
568
+ queryType(): FullTextQueryType;
569
+ }
570
+ export declare class BooleanQuery implements FullTextQuery {
571
+ /** @ignore */
572
+ readonly inner: JsFullTextQuery;
573
+ /**
574
+ * Creates an instance of BooleanQuery.
575
+ *
576
+ * @param queries - An array of (Occur, FullTextQuery objects) to combine.
577
+ * Occur specifies whether the query must match, or should match.
578
+ */
579
+ constructor(queries: [Occur, FullTextQuery][]);
580
+ queryType(): FullTextQueryType;
581
+ }