chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Feature Request]: Support metadata boolean filtering

Open digitaldesaster opened this issue 2 years ago • 1 comments

What happened?

data = collection.get(where={"is_feature": True}) print (len(data['documents'])) i = 0 for result in data['metadatas']: print (result['is_feature'])

i have a "is_feature" value in my metadata which is either True or False as boolean. the filter just doest not work.. which means i am getting all documents from the collection..

cheers Alex

Versions

chromdab 0.3.21 python 3.10.6 ubuntu

Relevant log output

No response

digitaldesaster avatar May 05 '23 11:05 digitaldesaster

Hi ! Technically speaking, boolean filtering is not supported. The supported types are str, int, float.

https://github.com/chroma-core/chroma/blob/25e2cffbfe547cc044186d4d5f4b659878a53e43/chromadb/api/types.py#L24

Could you try casting your data and using that? (i.e maybe use 0/1 for false/true)

I will turn this issue into a feature request as we 100% should support this! Thanks :)

HammadB avatar May 05 '23 17:05 HammadB

This should be addressed by #866

HammadB avatar Aug 14 '23 18:08 HammadB