Example usage for org.apache.solr.handler UpdateRequestHandler init

List of usage examples for org.apache.solr.handler UpdateRequestHandler init

Introduction

In this page you can find the example usage for org.apache.solr.handler UpdateRequestHandler init.

Prototype

@Override
    public void init(NamedList args) 

Source Link

Usage

From source file:uk.co.flax.biosolr.solr.update.processor.OntologyUpdateProcessorFactoryTest.java

License:Apache License

static void addDoc(String doc, String chain) throws Exception {
    Map<String, String[]> params = new HashMap<>();
    MultiMapSolrParams mmparams = new MultiMapSolrParams(params);
    params.put(UpdateParams.UPDATE_CHAIN, new String[] { chain });
    SolrQueryRequestBase req = new SolrQueryRequestBase(h.getCore(), mmparams) {
    };/*from  ww  w.j av a  2s .co  m*/

    UpdateRequestHandler handler = new UpdateRequestHandler();
    handler.init(null);
    ArrayList<ContentStream> streams = new ArrayList<>(2);
    streams.add(new ContentStreamBase.StringStream(doc));
    req.setContentStreams(streams);
    handler.handleRequestBody(req, new SolrQueryResponse());
    req.close();
}