File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -851,7 +851,7 @@ export class HierarchicalNavigableSmallWorld {
851851 loaded : any [ ] ,
852852 searchCondition : { target : number [ ] ; distance ?: string ; value ?: any } ,
853853 comparator : string ,
854- attributeName : string ,
854+ attributeName : string
855855 ) : any [ ] | null {
856856 if ( ! this . int8 || ! searchCondition . target || typeof attributeName !== 'string' ) return null ;
857857 if ( comparator === 'sort' ) {
@@ -870,8 +870,7 @@ export class HierarchicalNavigableSmallWorld {
870870 if ( comparator === 'lt' || comparator === 'le' ) {
871871 const thresholdValue = searchCondition . value ;
872872 const rescored = loaded . filter ( ( e ) => e !== SKIP && e && e . value ) ;
873- for ( const e of rescored )
874- e . distance = this . exactDistance ( searchCondition , e . value [ attributeName ] ) ;
873+ for ( const e of rescored ) e . distance = this . exactDistance ( searchCondition , e . value [ attributeName ] ) ;
875874 return rescored . filter ( ( e ) => ( comparator === 'le' ? e . distance <= thresholdValue : e . distance < thresholdValue ) ) ;
876875 }
877876 return null ;
Original file line number Diff line number Diff line change @@ -1219,7 +1219,8 @@ describeUnlessLmdb('HNSW int8 threshold queries (lt/le) — exact boundary after
12191219 ) ;
12201220 const ids = new Set ( results . map ( ( r ) => r . id ) ) ;
12211221 for ( const { id, sqDist } of records ) {
1222- if ( sqDist < threshold ) assert ( ids . has ( id ) , `record id=${ id } (sq_dist=${ sqDist } ) must appear with lt ${ threshold } ` ) ;
1222+ if ( sqDist < threshold )
1223+ assert ( ids . has ( id ) , `record id=${ id } (sq_dist=${ sqDist } ) must appear with lt ${ threshold } ` ) ;
12231224 else assert ( ! ids . has ( id ) , `record id=${ id } (sq_dist=${ sqDist } ) must not appear with lt ${ threshold } ` ) ;
12241225 }
12251226 } ) ;
You can’t perform that action at this time.
0 commit comments