0
votes

Need to search on a multivalued field in Sorl. Field name is "nodeclass" ,possible values are "pone", "bone" ,"hone" , "sone"and "node".

I want to get all docs which doesent contain "pone" value.

*:* query returns ---> 236636 docs nodeclass:pone returns ----> 1643 docs nodeclass:not(pone) returns ----> 2460 docs

all docs contains nodeclass field. here my guess is nodeclass:not(pone) should return 236636 -1643 = 234993

what am i missing here ?

2

2 Answers

0
votes

MatsLindh's proposal "*:* -nodeclass:pone" can be shortened to

-nodeclass:pone

or

NOT nodeclass:pone

The latter one is a little unusual. NOT has to be in uppercase.

0
votes

No idea where you got that syntax from, but to return all documents except for those that have pone:

*:* -nodeclass:pone

In effect, retrieve all documents and subtract the set that matches the query nodeclass:pone.