Yes, you can use a single IndexSearcher with multiple threads. I have done so in servlet environments. This is a common question, so I suggest you check the archives. Make sure your index is optimized.
Otis --- "Wilton, Reece" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a single IndexSearcher pointing at an index. Multiple threads > are calling the search method. Is this safe to do? I presume it is > the > right way to do it instead of creating a new IndexSearcher per > thread. > > But I'm having the dreaded "Too many open files" exception. I'm > running > on Windows XP (of course, otherwise it would work!). Any ideas on > how > to fix this (other than upgrading to Linux)? Is having one > IndexSearcher the right thing to do? No other processes are > accessing > this index so I'm surprised that I'm getting this error. > > Here's the exception: > > *E,17:25:19.649,/HyphenTest 5> java.io.IOException: Too many open > files > *E,17:25:19.664,/HyphenTest 5> at > java.io.WinNTFileSystem.createFileExclusively(Native Method) > *E,17:25:19.664,/HyphenTest 5> at > java.io.File.createNewFile(File.java:828) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.store.FSDirectory$1.obtain(FSDirectory.java:324) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.store.Lock.obtain(Lock.java:91) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.store.Lock$With.run(Lock.java:146) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.index.IndexReader.open(IndexReader.java:103) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.index.IndexReader.open(IndexReader.java:91) > *E,17:25:19.664,/HyphenTest 5> at > org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:75) > > Any help/advice is appreciated, > Reece > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
