类:Query\
用于LanceDB最近邻查询的构建器。
类型参数
| 名称 | 类型 |
|---|---|
T |
number[] |
目录
构造函数
属性
- _embeddings
- _fastSearch
- _filter
- _limit
- _metricType
- _nprobes
- _prefilter
- _query
- _queryVector
- _refineFactor
- _select
- _tbl
- where
方法
构造函数
构造函数
• 新建查询\<T>(query?, tbl?, embeddings?)
类型参数
| 名称 | 类型 |
|---|---|
T |
number[] |
参数
| 名称 | 类型 |
|---|---|
query? |
T |
tbl? |
any |
embeddings? |
EmbeddingFunction\<T> |
定义于
属性
_嵌入向量
• Protected Optional Readonly _embeddings: EmbeddingFunction\<T>
定义于
_快速搜索
• Private _fastSearch: boolean
定义于
_filter
• Private Optional _filter: string
定义于
_limit
• Private Optional _limit: number
定义于
_metricType
• Private Optional _metricType: MetricType
定义于
_nprobes
• Private _nprobes: number
定义于
_prefilter
• Private _prefilter: boolean
定义于
_查询
• Private Optional Readonly _query: T
定义于
_queryVector
• Private Optional _queryVector: number[]
定义于
_refineFactor
• Private Optional _refineFactor: number
定义于
_select
• Private Optional _select: string[]
定义于
_tbl
• Private Optional Readonly _tbl: any
定义于
where条件筛选
• where: (value: string) => Query\<T>
类型声明
▸ (value): Query\<T>
应用于此查询的筛选语句。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
string |
A filter in the same format used by a sql WHERE clause. |
返回
Query\<T>
定义于
方法
执行
▸ execute\<T>(): Promise\<T[]>
执行查询并将结果作为对象数组返回
类型参数
| 名称 | 类型 |
|---|---|
T |
Record\<string, unknown> |
返回值
Promise\<T[]>
定义于
快速搜索
▸ fastSearch(value): Query\<T>
跳过搜索未索引的数据。这可以加快搜索速度,但会遗漏任何尚未建立索引的数据。
参数
| 名称 | 类型 |
|---|---|
value |
boolean |
返回值
Query\<T>
定义于
筛选器
▸ 筛选(value): Query\<T>
应用于此查询的筛选语句。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
string |
A filter in the same format used by a sql WHERE clause. |
返回值
Query\<T>
定义于
isElectron
▸ Private isElectron(): boolean
返回值
boolean
定义于
限制
▸ limit(value): Query\<T>
设置返回结果的数量 默认值为10
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
number |
number of results |
返回值
Query\<T>
定义于
metricType
▸ metricType(value): Query\<T>
用于此查询的MetricType。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
MetricType |
The metric to the. |
返回值
Query\<T>
查看
不同选项的MetricType
定义于
nprobes
▸ nprobes(value): Query\<T>
使用的探测次数。数值越高,搜索越精确但速度也越慢。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
number |
The number of probes used. |
返回值
Query\<T>
定义于
预过滤器
▸ 预过滤(value): Query\<T>
参数
| 名称 | 类型 |
|---|---|
value |
boolean |
返回值
Query\<T>
定义于
refineFactor
▸ refineFactor(value): Query\<T>
通过读取额外元素并在内存中重新排序来优化结果。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
number |
refine factor to use in this query. |
返回值
Query\<T>
定义于
选择
▸ select(value): Query\<T>
仅返回指定的列。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
value |
string[] |
Only select the specified columns. If not specified, all columns will be returned. |
返回值
Query\<T>