fix: metric type for python/node search api (#1689)

This commit is contained in:
QianZhu
2024-09-24 16:10:29 -07:00
committed by GitHub
parent 962b3afd17
commit f00b21c98c
4 changed files with 9 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ import axios, { type AxiosResponse, type ResponseType } from 'axios'
import { tableFromIPC, type Table as ArrowTable } from 'apache-arrow'
import { type RemoteResponse, type RemoteRequest, Method } from '../middleware'
import { MetricType } from '..'
interface HttpLancedbClientMiddleware {
onRemoteRequest(
@@ -152,6 +153,7 @@ export class HttpLancedbClient {
refineFactor?: number,
columns?: string[],
filter?: string,
metricType?: MetricType,
fastSearch?: boolean
): Promise<ArrowTable<any>> {
const result = await this.post(
@@ -160,10 +162,11 @@ export class HttpLancedbClient {
vector,
k,
nprobes,
refineFactor,
refine_factor: refineFactor,
columns,
filter,
prefilter,
metric: metricType,
fast_search: fastSearch
},
undefined,

View File

@@ -239,6 +239,7 @@ export class RemoteQuery<T = number[]> extends Query<T> {
(this as any)._refineFactor,
(this as any)._select,
(this as any)._filter,
(this as any)._metricType,
(this as any)._fastSearch
)