chroma-core / chroma-core/chroma

[Bug]: collection.query() fails to retrieve documents even when metadata filter matches

Open
#5,367 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
29.3k
Forks
2.5k
Avg merge
1d 4h
Merged PRs (30d)
38

Description

### What happened?

I've been working with ChromaDB, and I've noticed a strange problem. I have a document in my collection, and I know it's there because I can get it by its ID or by using a where filter with the get() function. However, when I try to find it using the query() function, it doesn't show up. This seems wrong since I'm using filters that should definitely match the document.

Expected Behavior
I'd expect the query() function to find my document when I give it the correct metadata filters. It should look through all the documents that match those filters and then, if I've provided one, rank them based on semantic similarity.

Actual Behavior
The query() method returns an empty result set, even when I set the number of results to be very large. It's like the document isn't even being considered in the first place, even though I've confirmed it exists.

Workaround
I can successfully retrieve the document using the collection.get() function with the same metadata filter. This proves that the document is there and that my filter is correct. It's just the query() function that seems to be having a problem.

### Versions

Chroma v1.0.13, Python 3.9, Win11

### Relevant log output

```shell

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with Chroma v1.0.13, Python 3.9, and the same metadata-filtered get() and query() calls. Compare the documents returned by both methods and verify that query() considers filtered documents and returns the expected semantic results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.