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

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

Introduction

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

Prototype

public UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException 

Source Link

Document

Adds a single bean specifying max time before it becomes committed The bean is converted to a SolrInputDocument by the client's org.apache.solr.client.solrj.beans.DocumentObjectBinder

Usage

From source file:net.yacy.cora.federate.solr.instance.ServerShard.java

License:Open Source License

/**
 * Adds a single bean specifying max time before it becomes committed
 * @param obj  the input bean//from  w ww  . j  av  a 2 s  .co m
 * @param commitWithinMs  max time (in ms) before a commit will happen 
 * @throws IOException If there is a low-level I/O error.
 * @since solr 3.5
 */
@Override
public UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException {
    if (!this.writeEnabled)
        return _dummyOKResponse;
    UpdateResponse ur = null;
    for (SolrClient s : this.shards)
        ur = s.addBean(obj, commitWithinMs);
    return ur;
}