lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com.INVALID>
Subject Re: IndexSearcher.setSimilarity thread-safety
Date Mon, 05 Jan 2015 14:02:18 GMT
Hi Barry,

Thanks for chiming in. Then javadocs needs correction, right?

"multiple threads can call any of its methods, concurrently"

Ahmet


On Monday, January 5, 2015 3:28 PM, Barry Coughlan <b.coughlan2@gmail.com> wrote:
Just had a glance at the IndexSearcher code.

Changing the similarity would not cause any failures. However the change
may not be immediately seen by all threads because the variable is
non-volatile (I'm open to correction on that...).

If you need multiple threads to have different Similarity implementations
then you will need separate IndexSearcher instances. You can use a single
IndexReader for the IndexSearchers

Barry


On Mon, Jan 5, 2015 at 1:10 PM, Ahmet Arslan <iorixxx@yahoo.com.invalid>
wrote:

>
>
> anyone?
>
>
>
> On Thursday, December 25, 2014 4:42 PM, Ahmet Arslan
> <iorixxx@yahoo.com.INVALID> wrote:
> Hi all,
>
> Javadocs says "IndexSearcher instances are completely thread safe, meaning
> multiple threads can call any of its
> methods, concurrently"
>
> Is this true for setSimilarity() method?
>
> What happens when every thread uses different similarity implementations?
>
> Thanks,
> Ahmet
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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