Replies: 1 comment 1 reply
-
🤖 Hey @kolaente! Good to see you tackling new challenges with LlamaIndex. How's everything going? Based on the information available in the LlamaIndex repository, it seems that the Here is an example of how you might use the from llama_index.core.vector_stores.types import MetadataFilter, FilterOperator
# Create a MetadataFilter instance
filter = MetadataFilter(
key="source_id",
value=["id1", "id2", "id3"], # List of source_id values to filter by
operator=FilterOperator.IN
) However, this might not work as expected because the Please note that modifying the I hope this helps! If you have any other questions or need further clarification, please let me know. Sources
|
Beta Was this translation helpful? Give feedback.
-
Using the MetadataFilter, how can I filter by multiple values?
Consider the following: I have multiple sources for documents. These are saved as
source_id
in the embedding's metadata. When retriving content, I want to filter based on that id. Currently, I do this:(notice the
FilterCondition.OR
)Ideally, I'd like to use the
FilterOperator.IN
filter instead, like this:But it looks like the value of the filter must always be a str, int or float.
Is it possible at all what I want to achive?
Beta Was this translation helpful? Give feedback.
All reactions