: When I enter the query: "Table AND NOT Chair" I get one hit, doc3 : When I enter the query: "Table AND (NOT Chair)" I get 0 hits. : : I had thought that both queries would return the same results. Is this a : bug, or, am I not understanding the query language correctly?
it's a confusing eccentricity of the QueryParser syntax ... as a general rule, thing in parens need to be self contained, effective, queries ... if you have something in parens which would not make sense as a query by itself, then it won't make any more sense as part of a larger query. In your case, the query " NOT Chair " is the problem ... you can't have a negative clause in isolation by itself -- it doesn't make sense because there isn't anything positively selecting results for you to then exclude results from. As a side not: i strongly encourage you to train yourself to think in terms of MUST, MUST_NOT and SHOULD (which are represented in the query parser as the prefixes "+", "-" and the default) instead of in terms of AND, OR, and NOT ... Lucene's BooleanQuery (and thus Lucene's QueryParser) is not a strict Boolean Logic system, so it's best not to try and think of it like one. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]