You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by climbingrose <cl...@gmail.com> on 2007/12/02 13:58:39 UTC

Access to SolrIndexSearcher in UpdateProcessor

Hi all,

I'm trying to implement a custom UpdateProcessor which requires access to
SolrIndexSearcher. However, I'm constantly running into "Too many open
files" exception. I'm confused about which is the correct way to get access
to SolrIndexSearcher in UpdateProcessor:

1) req.getSearcher()
2) req.getCore().getSearcher()
3) req.getCore().newSearcher("MyCustomerProcessorFactory");

I have tried 1) & 3) but both produce "Too many open files". The weird thing
with 3) is the SolrIndexSearcher created gets set to null automatically by
Solr so I didn't have a chance to call searcher.close() method. I suspect
all searchers open this way will be set to null when a commit is made. Any
recommendation?

-- 
Regards,

Cuong Hoang

Re: Access to SolrIndexSearcher in UpdateProcessor

Posted by Chris Hostetter <ho...@fucit.org>.
: 
: I'm trying to implement a custom UpdateProcessor which requires access to
: SolrIndexSearcher. However, I'm constantly running into "Too many open
: files" exception. I'm confused about which is the correct way to get access
: to SolrIndexSearcher in UpdateProcessor:
: 
: 1) req.getSearcher()

that's the way i would expect should work best ... it will give you a 
consistent view of the index for the duration of the request.  i can't 
imagine why it would give you too many open files ... it should be a 
reused searcher shared by all concurrent requests, so accessing it 
shouldn't open more file handles.  Searchers are refrence counted ... 
maybe there is an edge case where they aren't getting freed up properly.

can you post a small example of the kind of UpdateProcessor you have (it 
doesn't need to do everything you are doing, just something that 
demonstrates the too many files bug)



-Hoss