|
1 | 1 | import { FilterValue } from '../filters/index.js'; |
| 2 | +import { MultiTargetVectorJoin } from '../index.js'; |
2 | 3 | import { Sorting } from '../sort/classes.js'; |
3 | 4 | import { |
4 | 5 | GroupByOptions, |
@@ -165,6 +166,10 @@ export type GroupByNearTextOptions<T> = BaseNearTextOptions<T> & { |
165 | 166 | /** The type of the media to search for in the `query.nearMedia` method */ |
166 | 167 | export type NearMediaType = 'audio' | 'depth' | 'image' | 'imu' | 'thermal' | 'video'; |
167 | 168 |
|
| 169 | +export type NearVectorInputType = number[] | number[][] | Record<string, number[]>; |
| 170 | + |
| 171 | +export type TargetVectorInputType = string | string[] | MultiTargetVectorJoin; |
| 172 | + |
168 | 173 | interface Bm25<T> { |
169 | 174 | /** |
170 | 175 | * Search for objects in this collection using the keyword-based BM25 algorithm. |
@@ -433,35 +438,35 @@ interface NearVector<T> { |
433 | 438 | * |
434 | 439 | * This overload is for performing a search without the `groupBy` param. |
435 | 440 | * |
436 | | - * @param {number[]} vector - The vector to search for. |
| 441 | + * @param {NearVectorInputType} vector - The vector(s) to search on. |
437 | 442 | * @param {BaseNearOptions<T>} [opts] - The available options for the search excluding the `groupBy` param. |
438 | 443 | * @returns {Promise<WeaviateReturn<T>>} - The result of the search within the fetched collection. |
439 | 444 | */ |
440 | | - nearVector(vector: number[], opts?: BaseNearOptions<T>): Promise<WeaviateReturn<T>>; |
| 445 | + nearVector(vector: NearVectorInputType, opts?: BaseNearOptions<T>): Promise<WeaviateReturn<T>>; |
441 | 446 | /** |
442 | 447 | * Search for objects by vector in this collection using a vector-based similarity search. |
443 | 448 | * |
444 | 449 | * See the [docs](https://weaviate.io/developers/weaviate/search/similarity) for a more detailed explanation. |
445 | 450 | * |
446 | 451 | * This overload is for performing a search with the `groupBy` param. |
447 | 452 | * |
448 | | - * @param {number[]} vector - The vector to search for. |
| 453 | + * @param {NearVectorInputType} vector - The vector(s) to search for. |
449 | 454 | * @param {GroupByNearOptions<T>} opts - The available options for the search including the `groupBy` param. |
450 | 455 | * @returns {Promise<GroupByReturn<T>>} - The group by result of the search within the fetched collection. |
451 | 456 | */ |
452 | | - nearVector(vector: number[], opts: GroupByNearOptions<T>): Promise<GroupByReturn<T>>; |
| 457 | + nearVector(vector: NearVectorInputType, opts: GroupByNearOptions<T>): Promise<GroupByReturn<T>>; |
453 | 458 | /** |
454 | 459 | * Search for objects by vector in this collection using a vector-based similarity search. |
455 | 460 | * |
456 | 461 | * See the [docs](https://weaviate.io/developers/weaviate/search/similarity) for a more detailed explanation. |
457 | 462 | * |
458 | 463 | * This overload is for performing a search with a programmatically defined `opts` param. |
459 | 464 | * |
460 | | - * @param {number[]} vector - The vector to search for. |
| 465 | + * @param {NearVectorInputType} vector - The vector(s) to search for. |
461 | 466 | * @param {NearOptions<T>} [opts] - The available options for the search. |
462 | 467 | * @returns {QueryReturn<T>} - The result of the search within the fetched collection. |
463 | 468 | */ |
464 | | - nearVector(vector: number[], opts?: NearOptions<T>): QueryReturn<T>; |
| 469 | + nearVector(vector: NearVectorInputType, opts?: NearOptions<T>): QueryReturn<T>; |
465 | 470 | } |
466 | 471 |
|
467 | 472 | /** All the available methods on the `.query` namespace. */ |
|
0 commit comments