Skip to content
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

[Feature Request]: multiple value filter on same key in mongoDB vector store. #13272

Open
JuHyung-Son opened this issue May 5, 2024 · 0 comments
Labels
enhancement New feature or request triage Issue needs to be triaged/prioritized

Comments

@JuHyung-Son
Copy link
Contributor

JuHyung-Son commented May 5, 2024

Feature Description

MongoDB vectore store does not support mutiple value filter on same key. However, this seems to be a very important feature.

llama_index.vector_stores.mongodb.base.py

def _to_mongodb_filter(standard_filters: MetadataFilters) -> Dict:
    """Convert from standard dataclass to filter dict."""
    filters = {}
    for filter in standard_filters.legacy_filters():
        filters[filter.key] = filter.value  # <- here, this does not make multiple values on key not applied
    return filters

I want to use filters like below.

filters = MetadataFilters(
    filters=[
        ExactMatchFilter(key="metadata.team", value="TEAM1"),   
        ExactMatchFilter(key="metadata.team", value="TEAM2"), # <- multiple values on key "metadata.team"
    ],
    condition=FilterCondition.OR,
)
 # MongoDBAtlasVectorSearch
query_engine = index.as_query_engine(
    filters=filters,
)

I don't know if this is caused by the llama index vector store not supporting the In operator, but I'd like you to look into it.

@JuHyung-Son JuHyung-Son added enhancement New feature or request triage Issue needs to be triaged/prioritized labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Issue needs to be triaged/prioritized
Projects
None yet
Development

No branches or pull requests

1 participant