lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niall Gallagher <niall.gallag...@analog.com>
Subject Re: IndexWriter Problem
Date Tue, 23 Dec 2003 14:11:44 GMT

 >> think I have resolved the problem. I was using Lucene to index 
several directories concurrently within
 >> the same JVM, and as far as I can tell Lucene cannot do coucurrent 
indexing. Is this correct ?

 > You can do it concurrently, but you must use the *same* IndexWriter 
instance on all threads.  

I was using different 'index' directories for each, it seems that there 
is some static resource that is not thread safe in some manner. For 
example my implementation went somthing like

for(int i = 0; i < 10; i++){
    new Thread(this).start();
}

public void run(){
   while(true){
       String path = queue.dequeue();
      
       if(isActive(path)){
          contuine;
       }
       activate(path);
       index(path,  new File(path, "index"));
   }
}

Should this work ? Because when I used it there was only ever one 
indexing task ever updating the index, that is, the last IndexWriter 
created was the only one updating its index directory.

Niall



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


Mime
View raw message