Quantcast
Channel: Weaviate Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 3590

Using like filter on text array

$
0
0

hi @ReverseHobo !

I believe this is what you are asking:

collection.data.insert({"text": "this is a test", "array": ["one", "two", "three"]})
collection.data.insert({"text": "this one test", "array": ["four", "five", "six"]})

# now we filter with like, or equal
collection.query.fetch_objects(
    filters=wvc.query.Filter.by_property("array").like("*ive")
).objects

collection.query.fetch_objects(
    filters=wvc.query.Filter.by_property("array").equal("four")
).objects

This is because everything will become a token. So you are not matching against a field (unless you specify the tokenization to field, more on tokenization here), but against tokens.

Let me know if this clarifies it.

Thanks!


Viewing all articles
Browse latest Browse all 3590

Trending Articles