Class: Query\<T>
A builder for nearest neighbor queries for LanceDB.
Type parameters
Name | Type |
---|---|
T | number [] |
Table of contents
Constructors
Properties
- _embeddings
- _fastSearch
- _filter
- _limit
- _metricType
- _nprobes
- _prefilter
- _query
- _queryVector
- _refineFactor
- _select
- _tbl
- where
Methods
Constructors
constructor
•new Query\<T
>(query?
,tbl?
,embeddings?
)
Type parameters
Name | Type |
---|---|
T | number [] |
Parameters
Name | Type |
---|---|
query? | T |
tbl? | any |
embeddings? | EmbeddingFunction \<T > |
Defined in
Properties
_embeddings
•Protected
Optional
Readonly
_embeddings:EmbeddingFunction
\<T
>
Defined in
_fastSearch
•Private
_fastSearch:boolean
Defined in
_filter
•Private
Optional
_filter:string
Defined in
_limit
•Private
Optional
_limit:number
Defined in
_metricType
•Private
Optional
_metricType:MetricType
Defined in
_nprobes
•Private
_nprobes:number
Defined in
_prefilter
•Private
_prefilter:boolean
Defined in
_query
•Private
Optional
Readonly
_query:T
Defined in
_queryVector
•Private
Optional
_queryVector:number
[]
Defined in
_refineFactor
•Private
Optional
_refineFactor:number
Defined in
_select
•Private
Optional
_select:string
[]
Defined in
_tbl
•Private
Optional
Readonly
_tbl:any
Defined in
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
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
fastSearch
▸fastSearch(value
):Query
\<T
>
Skip searching un-indexed data. This can make search faster, but will missany data that is not yet indexed.
Parameters
Name | Type |
---|---|
value | boolean |
Returns
Query
\<T
>
Defined in
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
isElectron
▸Private
isElectron():boolean
Returns
boolean
Defined in
limit
▸limit(value
):Query
\<T
>
Sets the number of results that will be returneddefault value is 10
Parameters
Name | Type | Description |
---|---|---|
value | number | number of results |
Returns
Query
\<T
>
Defined in
metricType
▸metricType(value
):Query
\<T
>
The MetricType used for this Query.
Parameters
Name | Type | Description |
---|---|---|
value | MetricType | The metric to the. |
Returns
Query
\<T
>
See
MetricType for the different options
Defined in
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
prefilter
▸prefilter(value
):Query
\<T
>
Parameters
Name | Type |
---|---|
value | boolean |
Returns
Query
\<T
>
Defined in
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
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
>