List of usage examples for org.apache.solr.client.solrj.request ContentStreamUpdateRequest setCommitWithin
public AbstractUpdateRequest setCommitWithin(int commitWithin)
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); } }