Filter by property in array

I have a class “KnowledgePieceChunk” where I want to store objects that contain text chunks that belong to one “KnowledgePiece” (the knowledge piece is going to be stored in a different database, I only want to store the chunks in Weaviate to do perform a search). I am storing the “knowledgePieceId” as metadata in a knowledge piece chunk.

Now there is the requirement to “select” multiple knowledge pieces to perform the search on the chunks. So lets say I want to perform the search on Weaviate to search for chunks that belong to knowledge piece with the ids 1 or 2. Which filter can I use for that use case? It is like the “$in” operator in MongoDB.
Is it even possible in Weaviate?

Thank you in advance.

hi @jonas.wascheroh !

Welcome to our community :hugs:

You want to use the ContainsAny/ContainsAll filter:

Let me know if that helps :slight_smile:

Thanks for using Weaviate!