Replies: 1 comment
-
🤖 Hello, Yes, LangChain does support range queries in vector searches similar to Weaviate and Supabase. You can use the Here's an example of how you can set a range for the 'page' metadata from 1 to 3: output = opensearch_vector_search.similarity_search(
"foo",
k=2,
boolean_filter=[
{"path": ["page"], "operator": "GreaterThanEqual", "valueNumber": 1},
{"path": ["page"], "operator": "LessThanEqual", "valueNumber": 3},
],
) In this code, You can find more details in the source code here:
I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to set a range while doing vector queries, so that instead of fetching the top n results I can specify that I want the 1st, 2nd, 3,rd result and so on.
This seems to be a supported function in several of the integrated vector DBs, see for example Weaviate and Supabase. How do I modify my queries using Langchain to make use of these functions? Is it supported?
Beta Was this translation helpful? Give feedback.
All reactions