Example usage for org.apache.solr.client.solrj.request ContentStreamUpdateRequest setCommitWithin

List of usage examples for org.apache.solr.client.solrj.request ContentStreamUpdateRequest setCommitWithin

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.request ContentStreamUpdateRequest setCommitWithin.

Prototype

public AbstractUpdateRequest setCommitWithin(int commitWithin) 

Source Link

Usage

From source file:net.yacy.cora.federate.solr.connector.SolrServerConnector.java

License:Open Source License

public void add(final File file, final String solrId) throws IOException {
    final ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");
    up.addFile(file, "application/octet-stream");
    up.setParam("literal.id", solrId);
    up.setParam("uprefix", "attr_");
    up.setParam("fmap.content", "attr_content");
    up.setCommitWithin(-1);
    //up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
    try {/*from w ww  . ja v  a 2s . co m*/
        this.server.request(up);
    } catch (final Throwable e) {
        clearCaches(); // prevent further OOM if this was caused by OOM
        throw new IOException(e);
    }
}