docs: document metadata filter operators on v2 search methods - #320
Open
Can Şahin (Cnashn) wants to merge 1 commit into
Open
docs: document metadata filter operators on v2 search methods#320Can Şahin (Cnashn) wants to merge 1 commit into
Can Şahin (Cnashn) wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
filterparameter on the v2AsyncPGVectorStoresearch methods accepts a rich metadata filter DSL ($eq,$ne,$gt,$gte,$lt,$lte,$in,$nin,$between,$exists,$like,$ilike,$and,$or,$not, plus nesteda.bpaths), but the method docstrings were one-line summaries that never mentionedfilteror the supported operators. Users end up guessing the syntax and running into surprises (e.g. #276, #304).This documents it:
asimilarity_searchgets a fullArgs/Returnsdocstring listing every supported operator with a short example.asimilarity_search_with_scoregets a conciseArgsblock that referencesasimilarity_searchfor the filter syntax.Notes
FILTERING_TEST_CASES, so the documented syntax matches tested behavior.Checks
ruff format --diffandruff checkpassmypypassestests/unit_tests/v2/test_async_pg_vectorstore_search.py: 159 passed