Re: Concurrent Issue

2011-04-08 Thread Michael McCandless
Yes, once you get the searcher you're free to access its underlying IndexReader. Just don't close it! And, be sure you call SearcherManager.release in a finally clause! Else the reader will not be closed... Mike http://blog.mikemccandless.com On Fri, Apr 8, 2011 at 6:54 AM, Piotr Pezik wrote:

Re: Concurrent Issue

2011-04-08 Thread Piotr Pezik
Thanks for the tips. Does the LIA SearcherManager provide/manage access to the IndexReader as well? In other words, is it as easy as: searcher.getIndexReader() ? I need some of the the Reader methods in addition to the Searcher ones. Piotr On 8 Apr 2011, at 12:21, Michael McCandless wrote

Re: Concurrent Issue

2011-04-08 Thread Michael McCandless
Actually, you shouldn't need a separate ReadWriteLock. SearcherManager (from LIA2's source code, freely downloadable from http://www.manning.com/hatcher3, with Apache License 2.0) handles the reference counting (so a reader is never closed while any search from other threads are stil in flight), a

Re: Concurrent Issue

2011-04-07 Thread Umesh Prasad
Building on Aditya's comments. 1. Lucene in Action has a SearchManager class which does most of 1-5 and manages indexreaders. 2. Reference counting is not the best approach, it is too low level and error prone. Instead Use ReadWriteLock

Re: Concurrent Issue

2011-04-06 Thread findbestopensource
You are trying to access the reader which is already closed by some other thread. 1. Keep a reference count for the reader you create. 2. Have a common function through which all functions will retrieve Reader objects 3. Once the index got changed, create a new reader, do warmup 4. When the new re

Re: Concurrent Issue

2011-04-06 Thread Piotr Pezik
Only to second this explanation. I got the same exception in a web application with a single IndexReader, accessed by many threads. The index gets updated every half hour or so, so I closed the old IndexReader and opened a new one every now and then. Even though the method for obtaining the

Re: Concurrent Issue

2011-04-06 Thread findbestopensource
You might have closed the IndexReader object but trying to access the search results. Regards Aditya www.findbestopensource.com On Tue, Apr 5, 2011 at 5:26 PM, Yogesh Dabhi wrote: > Hi > > > > My application is cluster in jobss application servers & lucene > directory was shared. > > > > Conc

Re: Concurrent Issue

2011-04-05 Thread Ian Lea
You don't say exactly how you are dealing with the concurrent access (one shared Reader/Searcher? Each user with own Reader/Searcher? Something else?) but the underlying problem is that the reader has been closed while something else is still using it. This can easily happen in a multi-threaded se

Concurrent Issue

2011-04-05 Thread Yogesh Dabhi
Hi My application is cluster in jobss application servers & lucene directory was shared. Concurrently 5 user access same lucene directory for searching document That time I got bellow exception org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed is there a way