Example usage for org.apache.solr.client.solrj SolrClient commit

List of usage examples for org.apache.solr.client.solrj SolrClient commit

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj SolrClient commit.

Prototype

public UpdateResponse commit(String collection, boolean waitFlush, boolean waitSearcher, boolean softCommit)
        throws SolrServerException, IOException 

Source Link

Document

Performs an explicit commit, causing pending documents to be committed for indexing Be very careful when triggering commits from the client side.

Usage

From source file:org.roda.core.index.utils.SolrUtils.java

private static void commit(SolrClient index, String... collections) {

    boolean waitFlush = false;
    boolean waitSearcher = true;
    boolean softCommit = true;

    for (String collection : collections) {
        try {/*  w  w w.java2s.com*/
            index.commit(collection, waitFlush, waitSearcher, softCommit);
        } catch (SolrServerException | IOException e) {
            LOGGER.error("Error commiting into collection: {}", collection, e);
        }
    }
}