Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Trejkaz
On Tue, Jan 6, 2015 at 1:40 AM, Barry Coughlan wrote: > Ideally the similarity field would not be mutable to indicate this, but I > suppose this would make the constructors very awkward. IndexSearcher(IndexReader, IndexSearcherConfig) wouldn't be all that bad and we're at least already used to it

Lucene Incremental Update to indexes

2015-01-05 Thread ankum
Hi, I did few searches around incremental updates, but found outdated posts, so just want to ensure I use the correct solution with the latest and greatest of Lucene API's and knowledge from experts. --- I have a large index of documents (say 4 million, each with unique application id's) - and I

AlreadyClosedException on new index

2015-01-05 Thread Brian Call
Hi Guys, So I’m seeing a problem in production that is very bizarre and I wanted to see if anyone else has encountered this issue and/or has a suggestion or fix. Here goes: We create a wrapper around an index and searcher manager to encapsulate both. First we create the IndexWriter and then im

Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Ahmet Arslan
Thanks for the explanation, Uwe. On Monday, January 5, 2015 7:30 PM, Uwe Schindler wrote: Hi, The documentation may be a bit incorrect, but in general it means: IndexSearcher is thread safe in regards to "searching". Getters/Setters are generally not thread safe for most classes. The docume

RE: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Uwe Schindler
Hi, The documentation may be a bit incorrect, but in general it means: IndexSearcher is thread safe in regards to "searching". Getters/Setters are generally not thread safe for most classes. The documentation is mainly to prevent people from synchronizing any external calls, because this would

Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Barry Coughlan
Hi Ahmet, The IndexSearcher is "thread-safe", it's just that the similarity field is shared between threads. I think that to most people it is implied that the similarity is not thread-local, as this would be surprising behavior. Ideally the similarity field would not be mutable to indicate this,

Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Ahmet Arslan
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 wrote: Just had a glance at the IndexSearcher code. Changing the similarity would not cause any failu

Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Barry Coughlan
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 impl

Re: IndexSearcher.setSimilarity thread-safety

2015-01-05 Thread Ahmet Arslan
anyone? On Thursday, December 25, 2014 4:42 PM, Ahmet Arslan 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