Skip to content

Commit

Permalink
Refactor filter expression for clarity and accuracy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dperezcabrera authored and tzolov committed Apr 10, 2024
1 parent ae9d3f4 commit fef1a42
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ vectorStore.similaritySearch(SearchRequest.defaults()
.withTopK(TOP_K)
.withSimilarityThreshold(SIMILARITY_THRESHOLD)
.withFilterExpression(b.and(
b.in("john", "jill"),
b.in("author","john", "jill"),
b.eq("article_type", "blog")).build()));
----

Expand Down

0 comments on commit fef1a42

Please sign in to comment.