FAQ
Can I reuse one Instance of IndexSearcher to do multiple searches (in
multiple threads) or do I have to instantiate a new IndexSearcher for
each search?

Search Discussions

  • Scott Ganyo at Aug 19, 2003 at 8:07 pm
    Yes. You can (and should for best performance) reuse an IndexSearcher
    as long as you don't need access to changes made to the index. An open
    IndexSearcher won't pick up changes to the index, so if you need to see
    the changes, you will need to open a new searcher at that point.

    Scott

    Aviran Mordo wrote:
    Can I reuse one Instance of IndexSearcher to do multiple searches (in
    multiple threads) or do I have to instantiate a new IndexSearcher for
    each search?

  • Kelvin Tan at Aug 20, 2003 at 1:41 am
    Yep. What I've done is hack a little class to pool the searchers, and whenever
    I update the index, I inform this manager class, and it refreshes the
    searchers. Of course, you can add sugar on top of that, like specifying a TTL
    or something like that.

    Kelvin

    On Tue, 19 Aug 2003 13:18:24 -0500, Scott Ganyo said:
    Yes. You can (and should for best performance) reuse an
    IndexSearcher
    as long as you don't need access to changes made to the index. An
    open
    IndexSearcher won't pick up changes to the index, so if you need to
    see
    the changes, you will need to open a new searcher at that point.

    Scott

    Aviran Mordo wrote:
    Can I reuse one Instance of IndexSearcher to do multiple searches
    (in
    multiple threads) or do I have to instantiate a new IndexSearcher
    for
    each search?



    ---------------------------------------------------------------------
    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
postedAug 19, '03 at 1:27p
activeAug 20, '03 at 1:41a
posts3
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase