Files
lancedb/docs/src/javascript/classes/Query.md
Leon Yee 9600a38ff0 [docs] fixed javascript docs for overloaded functions (#247)
Solves #244 :


![image](https://github.com/lancedb/lancedb/assets/43097991/d1fd9d2a-0d6a-4c16-a0ab-f460cc709349)

Problem was function overloading in the interface caused some weird
`typedoc` formatting, so breaking it apart into methods fixed the issue.

Also regenerated and updated javascript docs

---------

Co-authored-by: Tevin Wang <tevin@cmu.edu>
2023-07-04 13:07:34 -07:00

6.5 KiB

vectordb / Exports / Query

Class: Query<T>

A builder for nearest neighbor queries for LanceDB.

Type parameters

Name Type
T number[]

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Query<T>(tbl, query, embeddings?)

Type parameters

Name Type
T number[]

Parameters

Name Type
tbl any
query T
embeddings? EmbeddingFunction<T>

Defined in

index.ts:362

Properties

_embeddings

Private Optional Readonly _embeddings: EmbeddingFunction<T>

Defined in

index.ts:360


_filter

Private Optional _filter: string

Defined in

index.ts:358


_limit

Private _limit: number

Defined in

index.ts:354


_metricType

Private Optional _metricType: MetricType

Defined in

index.ts:359


_nprobes

Private _nprobes: number

Defined in

index.ts:356


_query

Private Readonly _query: T

Defined in

index.ts:352


_queryVector

Private Optional _queryVector: number[]

Defined in

index.ts:353


_refineFactor

Private Optional _refineFactor: number

Defined in

index.ts:355


_select

Private Optional _select: string[]

Defined in

index.ts:357


_tbl

Private Readonly _tbl: any

Defined in

index.ts:351


where

where: (value: string) => Query<T>

Type declaration

▸ (value): Query<T>

A filter statement to be applied to this query.

Parameters
Name Type Description
value string A filter in the same format used by a sql WHERE clause.
Returns

Query<T>

Defined in

index.ts:410

Methods

execute

execute<T>(): Promise<T[]>

Execute the query and return the results as an Array of Objects

Type parameters

Name Type
T Record<string, unknown>

Returns

Promise<T[]>

Defined in

index.ts:433


filter

filter(value): Query<T>

A filter statement to be applied to this query.

Parameters

Name Type Description
value string A filter in the same format used by a sql WHERE clause.

Returns

Query<T>

Defined in

index.ts:405


limit

limit(value): Query<T>

Sets the number of results that will be returned

Parameters

Name Type Description
value number number of results

Returns

Query<T>

Defined in

index.ts:378


metricType

metricType(value): Query<T>

The MetricType used for this Query.

See

MetricType for the different options

Parameters

Name Type Description
value MetricType The metric to the.

Returns

Query<T>

Defined in

index.ts:425


nprobes

nprobes(value): Query<T>

The number of probes used. A higher number makes search more accurate but also slower.

Parameters

Name Type Description
value number The number of probes used.

Returns

Query<T>

Defined in

index.ts:396


refineFactor

refineFactor(value): Query<T>

Refine the results by reading extra elements and re-ranking them in memory.

Parameters

Name Type Description
value number refine factor to use in this query.

Returns

Query<T>

Defined in

index.ts:387


select

select(value): Query<T>

Return only the specified columns.

Parameters

Name Type Description
value string[] Only select the specified columns. If not specified, all columns will be returned.

Returns

Query<T>

Defined in

index.ts:416