FAQ
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

Search Discussions

  • Otis Gospodnetic at Sep 10, 2003 at 9:28 am
    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" 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: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com
  • Wilton, Reece at Sep 10, 2003 at 6:59 pm
    Doh! I was creating a new IndexSearcher on every request. Doh!

    -----Original Message-----
    From: Otis Gospodnetic
    Sent: Wednesday, September 10, 2003 2:28 AM
    To: Lucene Users List
    Subject: Re: Multiple reads from an IndexSearcher?


    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" 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: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedSep 10, '03 at 1:03a
activeSep 10, '03 at 6:59p
posts3
users2
websitelucene.apache.org

2 users in discussion

Wilton, Reece: 2 posts Otis Gospodnetic: 1 post

People

Translate

site design / logo © 2022 Grokbase