On Mon, Mar 21, 2011 at 9:29 PM, Jonathan Rochkind <rochk...@jhu.edu> wrote: > So Solr 1.4.1, lucene query parser, generally has no problem with a query > that's simply one clause "NOT"" > > &defType=lucene > &q=NOT foo > > No problem! Also no problem: > > &q=foo AND NOT bar > > But, problem when the operand to an "OR" is a NOT: > > &q=foo OR (NOT bar) > > Does NOT work correctly. Can be worked around if you instead do this: > > &q=foo OR (*:* AND NOT bar) [...]
Yes, this is definitely a gotcha, but encountering the issue, and searching Google seems to find the above fix. Just went through the same thing a couple of weeks ago. Regards, Gora