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

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

Introduction

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

Prototype

UpdateRequestHandler

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) {
    };// w  w  w  .  j  a v a  2  s . c  om

    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();
}