Skip to content

Commit c95010d

Browse files
committed
Fix escaping issue in filterExpression for RedisVectorStore file name filtering
Signed-off-by: Minu Kim <kmw106933@naver.com>
1 parent c3dd57e commit c95010d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

spring-ai-vector-store/src/main/java/org/springframework/ai/vectorstore/SearchRequest.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ public Builder similarityThresholdAll() {
194194
/**
195195
* Retrieves documents by query embedding similarity and matching the filters.
196196
* Value of 'null' means that no metadata filters will be applied to the search.
197-
* <p>
198197
* For example if the {@link Document#getMetadata()} schema is:
199198
*
200199
* <pre>{@code
@@ -206,7 +205,7 @@ public Builder similarityThresholdAll() {
206205
* "isActive": <Boolean>
207206
* &#125;
208207
* }</pre>
209-
* <p>
208+
*
210209
* you can constrain the search result to only UK countries with isActive=true and
211210
* year equal or greater 2020. You can build this such metadata filter
212211
* programmatically like this:
@@ -218,10 +217,10 @@ public Builder similarityThresholdAll() {
218217
* new Expression(GTE, new Key("year"), new Value(2020)),
219218
* new Expression(EQ, new Key("isActive"), new Value(true))));
220219
* }</pre>
221-
* <p>
220+
*
222221
* The {@link Filter.Expression} is portable across all vector stores.<br/>
223-
* <p>
224-
* <p>
222+
*
223+
*
225224
* The {@link FilterExpressionBuilder} is a DSL creating expressions
226225
* programmatically:
227226
*
@@ -233,7 +232,7 @@ public Builder similarityThresholdAll() {
233232
* b.gte("year", 2020),
234233
* b.eq("isActive", true)));
235234
* }</pre>
236-
* <p>
235+
*
237236
* The {@link FilterExpressionTextParser} converts textual, SQL like filter
238237
* expression language into {@link Filter.Expression}:
239238
*
@@ -263,21 +262,21 @@ public Builder filterExpression(@Nullable Filter.Expression expression) {
263262
* "isActive": <Boolean>
264263
* &#125;
265264
* }</pre>
266-
* <p>
265+
*
267266
* then you can constrain the search result with metadata filter expressions like:
268267
*
269268
* <pre>{@code
270269
* country == 'UK' && year >= 2020 && isActive == true
271270
* Or
272271
* country == 'BG' && (city NOT IN ['Sofia', 'Plovdiv'] || price < 134.34)
273272
* }</pre>
274-
* <p>
273+
*
275274
* This ensures that the response contains only embeddings that match the
276275
* specified filer criteria. <br/>
277-
* <p>
276+
*
278277
* The declarative, SQL like, filter syntax is portable across all vector stores
279278
* supporting the filter search feature.<br/>
280-
* <p>
279+
*
281280
* The {@link FilterExpressionTextParser} is used to convert the text filter
282281
* expression into {@link Filter.Expression}.
283282
* @param textExpression declarative, portable, SQL like, metadata filter syntax.

0 commit comments

Comments
 (0)