Don't use an exclusive transaction to fill the database index table to allow concurrent searching.  Wait for search threads to die before killing the client. Allow search threads to be interrupted to avoid continuing to put more results in after another search has started.