lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Curtin" <m...@curtin.com>
Subject Re: Custom Sorting
Date Sat, 18 Feb 2006 16:15:31 GMT
I'm not sure you can do what you want in a single search.  But, I'm not sure I 
actually understand what your queries look like, either.  I *think* you want 
to search like

(title:a OR body:a) AND (title:b OR body:b) AND (title:c OR body:c)

not something like

(title:a OR title:b OR title:c) AND (body:a OR body:b OR body:c)

or maybe something else altogether.  If it's the former, and your data really 
has the title's text duplicated in the body, then I think you should run 2 
searches, like this:

#1	body:a AND body:b AND body:c
#2	title:a OR title:b OR title:c

#1 tells you whether you get a hit at all, and #2 tells you whether the title 
field was involved.  Putting the same criterion on title as on body in a given 
query is redundant, because there's nothing in title that isn't also in body. 
  You might even be able to do something like running #1, then using its 
results as a Filter for #2.

Good luck!

--MDC

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message