Commit cb28ba3
authored
Fix group precedence in
The `doGroup` override converted a parenthesized filter group into
`content && content`, duplicating the group body and dropping the
parentheses that expressed the grouping. Because Milvus binds `&&`
tighter than `||`, a filter such as
(year >= 2020 OR country == 'BG') AND city != 'Sofia'
was emitted without parentheses, so the trailing `AND` no longer
applied to the whole group and the query silently matched the wrong
documents.
Replace the override with the conventional `doStartGroup`/`doEndGroup`
hooks that wrap the group content in parentheses, consistent with the
other filter expression converters such as
`PgVectorFilterExpressionConverter`. Update the affected test, which
asserted the incorrect output, and add a test covering a group used as
the right-hand operand.
Closes #6543
Signed-off-by: Seol-JY <70826982+Seol-JY@users.noreply.github.com>MilvusFilterExpressionConverter
1 parent b84c9a8 commit cb28ba3
2 files changed
Lines changed: 19 additions & 4 deletions
File tree
- vector-stores/spring-ai-milvus-store/src
- main/java/org/springframework/ai/vectorstore/milvus
- test/java/org/springframework/ai/vectorstore/milvus
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| |||
0 commit comments