Got an interesting question about Lucene's behavior, as recently I was
handed something that look like this:
  ( +MEDICAL CAT^2 )  OR  ( +ANIMAL CAT^-2 )

The intention of the query is to say "if medical is found, then rank cat
[scans] high, but if animal is found then rank cat [a feline] low."

Problem is my understanding of Lucene tells me that there really is no AND /
OR set operations, and that instead Lucene has a REQUIRED, NOT_REQUIRED,
SHOULD setting for each term. As such, one might be able to "simulate"
certain kinds of AND/OR expressions, but that subexpression statements are
independently isn't happening.

Is my understanding correct, or will Lucene do this kind of magic?  The
actual query I was given to construct programatically was significantly more
complex.

-wls

Reply via email to