Hi everyone,

 I'm implementing a search component inherited from SearchComponent .

 This component has to build a data structure from the index. Like in
the SpellChecker, I trigger this building by giving a special argument
at query time  (from the process method) and I'm using the searcher I
get like this:

RefCounted<SolrIndexSearcher> search = rb.req.getCore()
                    .getSearcher();
...
search.decref();

I included this component at the end of the chain in my search handler.

What I'd like to do is to trigger this building for a first time at
solr startup so I don't need to artificially trigger it for a first
time.

I though it'd be ok to trigger this the very first time the process
method is called by doing something like that:

 private boolean firstTime= true ;

 public void process(ResponseBuilder rb) throws IOException {
    if ( firstTime ){
        firstTime = false ;
        buildMyStuff(rb) ;
    }
 }


The problem is that my method buildMyStuff hangs when calling
rb.req.getCore().getSearcher() ; ,
and I believe this is happening when the warm up queries are executed.

Furthermore, any regular queries on a solr instance like this would
hang and wait forever.

I there any way I can get around this problem, or is there a better
way to buildMyStuff a first time when solr is started up?

Cheers,

Jerome.

-- 
Jerome Eteve.

Chat with me live at http://www.eteve.net

[EMAIL PROTECTED]

Reply via email to