lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: about warm up
Date Thu, 22 Jul 2010 20:45:58 GMT

: I want to load full text into an external cache, So I added so codes
: in newSearcher where I found the warm up takes place. I add my codes


: public void newSearcher(SolrIndexSearcher newSearcher,
: SolrIndexSearcher currentSearcher) {
:     warmTextCache(newSearcher,warmTextCache,new String[]{"title","content"});


: in warmTextCache I need a reader to get some docs


: So I need a reader, When I contruct a reader by myself like:
: IndexReader;
: Or by core.getSearcher().get().getReader()

Don't do that -- the readers/searchers are refrenced counted by the 
SolrCore, so unless you "release" your refrences cleanly all you are 
likely to get into some interesting situations

the newSearcher method you are implementing directly gives you the 
SolrIndexSearcher (the "newSearcher" arg) that will be used along with 
your cache .  why don't you use it to get the reader (the 
getReader() method)instead of jumping through these hoops you've been 



View raw message