{
....
otherProperty: 'otherValue' // This object doesn't have the property 'keywords'
....
}
I want to perform a query that returns all the objects that don’t have the keyword ‘keyword1’ in the property ‘keywords’. I expect to get objects 2, 3, and 4.
I tried with the following query, but it doesn’t work:
{
Get {
Test (
where: {
operator: NotEqual
path:["keywords"]
valueText:"keyword1"
}
){
keywords
}
}
}
The problem here is actually with finding an object for which a given text element does Not appear in an array; returning object #4 is secondary and could be done with a nested where filter.
As of now, Weaviate doesn’t support finding objects in which the specified array does not contain an element. Your GraphQL query arguably returns object #1 as a correct result because keyword2 (and keyword3) in the array are NotEqual to keyword1.
You may want to follow this forum thread and the associated GitHub issue: