(11/07/11 4:45), Gabriele Kahlout wrote:
On Sun, Jul 10, 2011 at 6:21 PM, Koji Sekiguchi<k...@r.email.ne.jp>  wrote:

There are such RequestHandlers. Look at CSVRequestHandler, for example.



              IndexWriter writer = new IndexWriter(FSDirectory.open(**new
File(req.getCore().getDataDir(**), "index")),
req.getSchema().getAnalyzer(),
IndexWriter.MaxFieldLength.**LIMITED);
             updateSolrIndex(writer);


Don't use your own writer for same index. Use 
UpdateRequestProcessor.**processAdd()
instead.


What you seem to be suggesting is:

UpdateRequestProcessorChain processorChain =
             req.getCore().getUpdateProcessingChain("WcUpdate");
         UpdateRequestProcessor processor =
processorChain.createProcessor(req, rsp);
try{
         RequestHandlerUtils.handleCommit(processor, params, false);
         RequestHandlerUtils.handleRollback(processor, params, false);
}finally{
     processor.finish();
}

But this is not what I want. I want an IndexWriter instance from which I can
get a reader, the analyzer in use, and the similarity class. If I shall
crease a new IndexWriter for the same index, can I re-use the current one
directly, without the UpdateRequestProcessor interface?

Technically, unless you have your own update handler that extends 
DirectUpdateHandler2
as it has the IndexWriter as protected member, I don't think you can do it.

koji
--
http://www.rondhuit.com/en/

Reply via email to