1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export declare enum VectorQueryCombination {
|
7 | |
8 |
|
9 |
|
10 | AND = "and",
|
11 | |
12 |
|
13 |
|
14 | OR = "or"
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 | export interface VectorSearchOptions {
|
20 | |
21 |
|
22 |
|
23 | vectorQueryCombination?: VectorQueryCombination;
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare class VectorQuery {
|
31 | private _fieldName;
|
32 | private _vector;
|
33 | private _vectorBase64;
|
34 | private _numCandidates;
|
35 | private _boost;
|
36 | constructor(fieldName: string, vector: number[] | string);
|
37 | /**
|
38 | * @internal
|
39 | */
|
40 | toJSON(): any;
|
41 | /**
|
42 | * Adds boost option to vector query.
|
43 | *
|
44 | * @param boost A floating point value.
|
45 | */
|
46 | boost(boost: number): VectorQuery;
|
47 | /**
|
48 | * Adds numCandidates option to vector query. Value must be >= 1.
|
49 | *
|
50 | * @param numCandidates An integer value.
|
51 | */
|
52 | numCandidates(numCandidates: number): VectorQuery;
|
53 | /**
|
54 | * Creates a vector query.
|
55 | *
|
56 | * @param fieldName The name of the field in the JSON document that holds the vector.
|
57 | * @param vector List of floating point values that represent the vector.
|
58 | */
|
59 | static create(fieldName: string, vector: number[] | string): VectorQuery;
|
60 | }
|
61 | /**
|
62 | * Represents a vector search.
|
63 | *
|
64 | * @category Full Text Search
|
65 | */
|
66 | export declare class VectorSearch {
|
67 | private _queries;
|
68 | private _options;
|
69 | constructor(queries: VectorQuery[], options?: VectorSearchOptions);
|
70 | /**
|
71 | * @internal
|
72 | */
|
73 | get queries(): VectorQuery[];
|
74 | /**
|
75 | * @internal
|
76 | */
|
77 | get options(): VectorSearchOptions | undefined;
|
78 | /**
|
79 | * Creates a vector search from a single VectorQuery.
|
80 | *
|
81 | * @param query A vectory query that should be a part of the vector search.
|
82 | */
|
83 | static fromVectorQuery(query: VectorQuery): VectorSearch;
|
84 | }
|