The simplese way is to create indexsearcher instance for each searching request....
or create indexsearcher for each index folder (such as indexX, indexY,...), then write a function to choose correct indexsearcher for related searching request... On 4/12/06, wenjie zheng <[EMAIL PROTECTED]> wrote: > > My question is a little bit long. Thanks for your patience. > > I am working on project which requires remote searching ability. So I use > RMI and RemoteSearchable class. Here is the system structure: > Server A has all the indices on it and the RemoteSearchable object running > on it. Server B accepts queries and use ParallelMultiSearcher and RMI to > search the indices on Server A. > There are many indices on Server A, based on query I received, I choose > different index to search from . > > For example, if I the query is from X, we will search indexX; if the query > is from Y, we will search indexY. In order to do that, I changed the > Searchable interface a little bit by adding function load(String folder) > and > implement it in all the subclasses. What load() does is to close the > underlining reader of the first index and open the reader for the second > index. > > So here is the problem I bumped into. When there are more than one queries > coming at the same time and I wanted to process them in parallel, the > load() function called by the second query may accidently close the the > reader of the first index, while searching on the first index is not > finished yet. > > So, do I have to queue the queries up and execute them one after the > other? > Or do I have other options? > > Thanks, > Wenjie > >