Solr query not operator for filtering string array

1.1k views Asked by At

I want to return all the documents which doesn't have "hello" string in the "test" key. So, I created following query which is not filtering the documents containing "hello" q: -test:("hello")

[{
 "test":["hello", "second"],
  id:123
},
{
 "test":["hello1", "second1"],
  id:1234
}
]

Expected result:

[
 "test":["hello1", "second1"],
  id:1234
}
]
1

There are 1 answers

0
cherry On BEST ANSWER

"test" is a string with multivalued=true and indexed=false. Seems like the filtering in solr works only for indexed fields. Once I made the field "test" indexed the filtering is working fine.