Commit 10b4c60
authored
Fix PostgresDbClient GetSimilarAsync minSimilarity requirement (#1057)
## Motivation and Context (Why the change? What's the scenario?)
Since #684 The PostgresDbClient will fail to return results that match
the minSimilarity requirement when multiple filters are used. This is
due to how the ```WHERE``` clause is prepared: ```filter1 OR filter2 OR
filter3 AND embedding <=> @Embedding < @maxDistance``` which cannot work
as expected since the `AND` operator takes precedence over the `OR`
operator
## High level description (Approach, Design)
Simply add parenthesis around the filters argument1 parent 164c159 commit 10b4c60
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | 419 | | |
424 | 420 | | |
425 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
0 commit comments