On 3/20/06, Stephen Gray <[EMAIL PROTECTED]> wrote: > I want to re-create the IndexSearcher whenever the index changes, but I'm > assuming that if I do this bad things will happen to people who may be > currently running a search, or paging through a Hits collection created by > a previous search (the javadocs on Searchable.close say that you should not > call close while using objects like Hits). I could maintain an "open > searches" variable and check it every second, but I'd still have the > problem of existing Hits collections. > > Could someone tell me the best way to do this?
Solr uses reference counting on the IndexSearcher to solve this problem. When a new searcher has finished warming up, it is "registered" to serve any new requests . The old searcher hangs around until everyone is done using it, then it is closed. -Yonik http://incubator.apache.org/solr Solr, The Open Source Lucene Search Server --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]