Hi,

To merge TopDocs with "compatible scores", you can use the new Lucene (since 
3.3) method: TopDocs.merge(). Just execute the query on different indexes with 
same topdocs count and execute this method.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Trejkaz [mailto:trej...@trypticon.org]
> Sent: Wednesday, February 15, 2012 1:57 AM
> To: java-user@lucene.apache.org
> Subject: Re: Merging results from two searches on two separate Searchers
> 
> On Wed, Feb 15, 2012 at 11:46 AM, Uwe Schindler <u...@thetaphi.de> wrote:
> > Scores are only compatible if the query is the same, which is not the case 
> > for
> you.
> > So you cannot merge hits from different queries.
> 
> So I guess in the case where the different query parsers happen to generate 
> the
> same query, it's safe to do then. This is actually much better than I was
> expecting. :)
> 
> Which leaves the (hopefully rarer) case of them generating actually-different
> queries.
> 
> I assume the cause for the incompatibility is something like this:
> 
>   User's query: "cats"
>   Suppose query parser 1 converts to "text:cats"
>   Suppose query parser 2 converts to "text:cat"
> 
> Because query parser 2 is converting "cat" -> "cat" as well as "cats"
> -> "cat", this affects the doc frequency of "cat", which as a result
> affects the score.
> 
> But of course we want all the results in one list at the end, so we have to 
> merge
> it *somehow*. So I was wondering that if the score by itself is not enough,
> maybe there is some way to weight it so that it can be merged again.
> 
> TX
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org


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

Reply via email to