lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SOME ONE <sum...@yahoo.com>
Subject Re: Custom Sorting
Date Mon, 20 Feb 2006 15:02:12 GMT
Hi,

Yes, my queries are like the first case. And as there
have been no other suggestions to do it in a single
search operation, will have to do it the way you
suggested. This technique will do the job particularly
because title's text is always in the body as well. So
finally I will have to run two search operations like

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

to get the first group of results for title match, and

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

to get the second group of results with just body
match, and sort each group by date.

As the queries in two operations are very similar,
even if there is overhead involved by doing it in two
search operations, I think it can be improved by using
filters that cache results and reuse them in the
second search operation. But I'm not sure how much
overhead would there be for doing it in two search
operations, and if this optimization is really needed.

Thanks once again for your help.

Regards
Wiseman


--- "Michael D. Curtin" <mike@curtin.com> wrote:

> 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
> 
> 


Send instant messages to your online friends http://uk.messenger.yahoo.com 

---------------------------------------------------------------------
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