File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed
integration/tools/mongodb/create Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ describeAccuracyTests(
8080 {
8181 type : "vector" ,
8282 path : "plotSummary" ,
83- numDimensions : 1024 ,
83+ numDimensions : " 1024" ,
8484 } ,
8585 ] ,
8686 } ,
@@ -106,17 +106,19 @@ describeAccuracyTests(
106106 {
107107 type : "vector" ,
108108 path : "plotSummary" ,
109- numDimensions : Matcher . number (
110- ( value ) => value % 2 === 0 && value >= 256 && value <= 8192
111- ) ,
109+ numDimensions : Matcher . string ( ( value ) => {
110+ const intValue = parseInt ( value ) ;
111+ return intValue % 2 === 0 && intValue >= 256 && intValue <= 8192 ;
112+ } ) ,
112113 similarity : Matcher . anyOf ( Matcher . undefined , Matcher . string ( ) ) ,
113114 } ,
114115 {
115116 type : "vector" ,
116117 path : "genre" ,
117- numDimensions : Matcher . number (
118- ( value ) => value % 2 === 0 && value >= 256 && value <= 8192
119- ) ,
118+ numDimensions : Matcher . string ( ( value ) => {
119+ const intValue = parseInt ( value ) ;
120+ return intValue % 2 === 0 && intValue >= 256 && intValue <= 8192 ;
121+ } ) ,
120122 similarity : Matcher . anyOf ( Matcher . undefined , Matcher . string ( ) ) ,
121123 } ,
122124 ] ,
@@ -143,7 +145,7 @@ describeAccuracyTests(
143145 {
144146 type : "vector" ,
145147 path : "plotSummary" ,
146- numDimensions : 1024 ,
148+ numDimensions : " 1024" ,
147149 } ,
148150 {
149151 type : "filter" ,
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ export abstract class Matcher {
3232 return new BooleanMatcher ( expected ) ;
3333 }
3434
35- public static string ( ) : Matcher {
36- return new StringMatcher ( ) ;
35+ public static string ( additionalFilter : ( value : string ) => boolean = ( ) => true ) : Matcher {
36+ return new StringMatcher ( additionalFilter ) ;
3737 }
3838
3939 public static caseInsensitiveString ( text : string ) : Matcher {
@@ -153,8 +153,11 @@ class BooleanMatcher extends Matcher {
153153}
154154
155155class StringMatcher extends Matcher {
156+ constructor ( private additionalFilter : ( value : string ) => boolean = ( ) => true ) {
157+ super ( ) ;
158+ }
156159 public match ( actual : unknown ) : number {
157- return typeof actual === "string" ? 1 : 0 ;
160+ return typeof actual === "string" && this . additionalFilter ( actual ) ? 1 : 0 ;
158161 }
159162}
160163
Original file line number Diff line number Diff line change @@ -948,7 +948,7 @@ describeWithMongoDB(
948948 {
949949 getUserConfig : ( ) => ( {
950950 ...defaultTestConfig ,
951- previewFeatures : [ "vectorSearch " ] ,
951+ previewFeatures : [ "search " ] ,
952952 } ) ,
953953 downloadOptions : {
954954 search : true ,
You can’t perform that action at this time.
0 commit comments