Skip to content

[Question]: Filtering on metadata in SimpleVectorStore index #8361

Closed Answered by dosubot bot
AravAct asked this question in Q&A
Discussion options

You must be logged in to vote

🤖

Hello,

Yes, there is a feature in the SimpleVectorStore index of LlamaIndex that allows filtering on both metadata and doc_id while querying. This feature enables the creation of a combined index that can answer from all files or a single file as per the user's requirement.

Here is an example of how you can use this feature:

from llama_index import Document
from llama_index.vector_stores.types import ExactMatchFilter, MetadataFilters

# Insert a document with specific metadata
doc = Document(text="target", metadata={"tag": "target"})
index.insert(doc)

# Create a filter that matches the inserted metadata
filters = MetadataFilters(
    filters=[ExactMatchFilter(key="tag", value="target")…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AravAct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
2 participants
Converted from issue

This discussion was converted from issue #6908 on October 24, 2023 06:29.