Overview

Lucene has an internal caching mechanism which makes searches using long-lived IndexSearcher objects faster than searches with newly created IndexSearcher instances. One shared IndexSearcher instance would be enough to get fast searches in single-user environment, but a standard use case in a server environment is that multiple clients search the index simultaneously. To avoid sequencing the search requests in this setting, which would degrade individual search performance, the GSS uses an IndexSearcher pool that keeps a defined number of IndexSearcher instances for reuse by simultaneous search requests.

An IndexSearcher will only see the index as of the "point in time" that it was opened. Any updates to the index after the IndexSearcher was opened are not visible until the IndexSearcher is re-opened. Each IndexSearcher instance can use a very significant amount of memory depending on index size and whether the index has been updated in the meantime or not. The IndexSearcher pool takes care of closing and reopening IndexSearcher instances when an index update occurs.