File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -103,14 +103,16 @@ export type Bm25Options<T> = BaseBm25Options<T> | GroupByBm25Options<T> | undefi
103
103
export type BaseHybridOptions < T > = SearchOptions < T > & {
104
104
/** The weight of the BM25 score. If not specified, the default weight specified by the server is used. */
105
105
alpha ?: number ;
106
- /** The specific vector to search for or a specific vector subsearch. If not specified, the query is vectorized and used in the similarity search. */
107
- vector ?: NearVectorInputType | HybridNearTextSubSearch | HybridNearVectorSubSearch ;
108
- /** The properties to search in. If not specified, all properties are searched. */
109
- queryProperties ?: ( PrimitiveKeys < T > | Bm25QueryProperty < T > ) [ ] ;
110
106
/** The type of fusion to apply. If not specified, the default fusion type specified by the server is used. */
111
107
fusionType ?: 'Ranked' | 'RelativeScore' ;
108
+ /** The maximum tolerated similarity in the vector search before the results are cutoff from the result set. */
109
+ maxVectorDistance ?: number ;
110
+ /** The properties to search in. If not specified, all properties are searched. */
111
+ queryProperties ?: ( PrimitiveKeys < T > | Bm25QueryProperty < T > ) [ ] ;
112
112
/** Specify which vector(s) to search on if using named vectors. */
113
113
targetVector ?: TargetVectorInputType ;
114
+ /** The specific vector to search for or a specific vector subsearch. If not specified, the query is vectorized and used in the similarity search. */
115
+ vector ?: NearVectorInputType | HybridNearTextSubSearch | HybridNearVectorSubSearch ;
114
116
} ;
115
117
116
118
export type HybridSubSearchBase = {
Original file line number Diff line number Diff line change @@ -519,6 +519,7 @@ export class Serialize {
519
519
alpha : args . alpha ? args . alpha : 0.5 ,
520
520
properties : this . bm25QueryProperties ( args . queryProperties ) ,
521
521
vectorBytes : vectorBytes ,
522
+ vectorDistance : args . maxVectorDistance ,
522
523
fusionType : fusionType ( args . fusionType ) ,
523
524
targetVectors,
524
525
targets,
Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ describe('Unit testing of Serialize', () => {
154
154
vector : [ 1 , 2 , 3 ] ,
155
155
targetVector : 'title' ,
156
156
fusionType : 'Ranked' ,
157
+ maxVectorDistance : 0.4 ,
157
158
supportsTargets : false ,
158
159
supportsVectorsForTargets : false ,
159
160
supportsWeightsForTargets : false ,
@@ -166,6 +167,7 @@ describe('Unit testing of Serialize', () => {
166
167
vectorBytes : new Uint8Array ( new Float32Array ( [ 1 , 2 , 3 ] ) . buffer ) ,
167
168
targetVectors : [ 'title' ] ,
168
169
fusionType : Hybrid_FusionType . FUSION_TYPE_RANKED ,
170
+ vectorDistance : 0.4 ,
169
171
} ) ,
170
172
metadata : MetadataRequest . fromPartial ( { uuid : true } ) ,
171
173
} ) ;
You can’t perform that action at this time.
0 commit comments