lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walt Stoneburner" <walt.stonebur...@gmail.com>
Subject ORs and Ranks
Date Mon, 05 Jan 2009 19:33:15 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message