Example usage for org.apache.solr.request SolrQueryRequestBase close

List of usage examples for org.apache.solr.request SolrQueryRequestBase close

Introduction

In this page you can find the example usage for org.apache.solr.request SolrQueryRequestBase close.

Prototype

@Override
public void close() 

Source Link

Document

Frees resources associated with this request, this method must be called when the object is no longer in use.

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