Skip to content

Commit 5888fae

Browse files
committed
Refactor filter expression for clarity and accuracy
The filter expression within the document handling logic has been updated to enhance clarity and ensure accurate author filtering. Previously, the `in` function mistakenly included names as direct arguments, potentially leading to ambiguity in filter application. This has been corrected by explicitly specifying the `author` field, ensuring the filter accurately applies to author names only. This change improves the maintainability and readability of the code, particularly in sections dealing with article filtering based on authorship and type. - Correct the filter expression by explicitly specifying the `author` field. - Ensure accurate and unambiguous author filtering in article management.
1 parent 754dab9 commit 5888fae

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/milvus.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ vectorStore.similaritySearch(SearchRequest.defaults()
145145
.withTopK(TOP_K)
146146
.withSimilarityThreshold(SIMILARITY_THRESHOLD)
147147
.withFilterExpression(b.and(
148-
b.in("john", "jill"),
148+
b.in("author","john", "jill"),
149149
b.eq("article_type", "blog")).build()));
150150
----
151151

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/mongodb.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ vectorStore.similaritySearch(SearchRequest.defaults()
7474
.withTopK(TOP_K)
7575
.withSimilarityThreshold(SIMILARITY_THRESHOLD)
7676
.withFilterExpression(b.and(
77-
b.in("john", "jill"),
77+
b.in("author", "john", "jill"),
7878
b.eq("article_type", "blog")).build()));
7979
----
8080

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/neo4j.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ vectorStore.similaritySearch(SearchRequest.defaults()
159159
.withTopK(TOP_K)
160160
.withSimilarityThreshold(SIMILARITY_THRESHOLD)
161161
.withFilterExpression(b.and(
162-
b.in("john", "jill"),
162+
b.in("author", "john", "jill"),
163163
b.eq("article_type", "blog")).build()));
164164
----
165165

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/qdrant.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ vectorStore.similaritySearch(SearchRequest.defaults()
171171
.withTopK(TOP_K)
172172
.withSimilarityThreshold(SIMILARITY_THRESHOLD)
173173
.withFilterExpression(b.and(
174-
b.in("john", "jill"),
174+
b.in("author", "john", "jill"),
175175
b.eq("article_type", "blog")).build()));
176176
----
177177

0 commit comments

Comments
 (0)