You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Israel Tsadok <it...@gmail.com> on 2007/05/29 11:45:50 UTC

MultiSearcher, Hits and createWeight

Hi,
I am developing a distributed index, using MultiSearcher and RemoteSearcher.
When investigating some performance issues, I noticed that there is a lot of
back-and-forth traffic between the servers during the weight calculation.
Although MultiSearcher has a method called createWeight that minimizes the
calls to the sub-searchers, this method never actually gets called when I
call search(query).

>From what I can tell, this is fixable by changing in Hits.java the line:
weight = q.weight(s);
to:
weight = s.createWeight(q);

I made that change, and it seems to work OK, but I don't know enough about
Lucene to be sure that it's safe.
Have I got something wrong? Is it safe to make that change?

Thanks,
Israel Tsadok

Re: MultiSearcher, Hits and createWeight

Posted by Chris Hostetter <ho...@fucit.org>.
Israel, I don't really know much about MultiSearcher, but just to clarify:
are you saying that the change you have works ok, as long as people are
also using hte patch in LUCENE-789 (which will be in 2.2) or are you
saying that the change you tried doesn't work when using a custom
similarity, for the same reasons as LUCENE-789?

If it does work with the patch in LUCENE-789 and provies the same results
with less network overhead, then by all means please open a jira issue and
submit a patch ... it seems like a simple change and it seems correct to
me ... hopefully someone more knowledgable about MultiSearcher then myself
can comment on it and we can commit it.



-Hoss


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


Re: MultiSearcher, Hits and createWeight

Posted by Israel Tsadok <it...@gmail.com>.
In case anyone was interested, making the change I described surfaced a bug
that causes the custom similarity to not work.
There is a patch:
https://issues.apache.org/jira/browse/LUCENE-789


On 5/29/07, Israel Tsadok <it...@gmail.com> wrote:
>
> Hi,
> I am developing a distributed index, using MultiSearcher and
> RemoteSearcher. When investigating some performance issues, I noticed that
> there is a lot of back-and-forth traffic between the servers during the
> weight calculation.
> Although MultiSearcher has a method called createWeight that minimizes the
> calls to the sub-searchers, this method never actually gets called when I
> call search(query).
>
> From what I can tell, this is fixable by changing in Hits.java the line:
> weight = q.weight(s);
> to:
> weight = s.createWeight(q);
>
> I made that change, and it seems to work OK, but I don't know enough about
> Lucene to be sure that it's safe.
> Have I got something wrong? Is it safe to make that change?
>
> Thanks,
> Israel Tsadok