New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with JSONPath with a in array check #247
Comments
Thanks for reporting. While we investigate, would you like to use Zep filter boolean logic here rather than an https://docs.getzep.com/sdk/search_query/#combining-multiple-jsonpath-filters-using-boolean-logic |
Thanks @danielchalef for your quick feedback. Am trying to test out Zep for a use case that I have, so will wait for your response while I continue. Needless to say wanted to be able to check against a variable which has a List of filenames that user provides to run a query against. |
Any luck with this @danielchalef ? |
Hey @raghavendracs unfortunately I've not had time to investigate. We use Postgres' JSONPath flavor. If the https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-SQLJSON-PATH |
Describe the bug
I am trying to use a filter clause as follows
metadata_query = {"where": {
"jsonpath": "[$[*] ? (@.source in ['a', 'b'])]"}}
retriever = vs.as_retriever(
search_kwargs={"metadata": metadata_query})
To Reproduce
just create a ZepVectorStore and try the above
Expected behavior
able to define a retriever which will only fetch documents which have source as either a or b
Logs
Am getting this error
zep_python.exceptions.APIError: API error: {'status_code': 500, 'message': 'failed to search collection: failed to execute search: error executing search: error executing query: error scanning query ERROR: syntax error at or near "[" of jsonpath input (SQLSTATE=42601)\n'}
The JSONPath expression is fine as far as I can see. So is that I can only filter simple ==, != etc based checks?
The text was updated successfully, but these errors were encountered: