Example usage for org.apache.solr.client.solrj.request UpdateRequest setDocIterator

List of usage examples for org.apache.solr.client.solrj.request UpdateRequest setDocIterator

Introduction

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

Prototype

public void setDocIterator(Iterator<SolrInputDocument> docIterator) 

Source Link

Usage

From source file:com.nkang.kxmoment.util.SolrUtils.HttpSolrServer.java

License:Apache License

/**
 * Adds the documents supplied by the given iterator.
 * /*from   w w  w. java  2 s .c o m*/
 * @param docIterator
 *          the iterator which returns SolrInputDocument instances
 * 
 * @return the response from the SolrServer
 */
public UpdateResponse add(Iterator<SolrInputDocument> docIterator) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.setDocIterator(docIterator);
    return req.process(this);
}

From source file:com.nkang.kxmoment.util.SolrUtils.HttpSolrServer.java

License:Apache License

/**
 * Adds the beans supplied by the given iterator.
 * //from  w w  w.  j av a  2  s .  c om
 * @param beanIterator
 *          the iterator which returns Beans
 * 
 * @return the response from the SolrServer
 */
public UpdateResponse addBeans(final Iterator<?> beanIterator) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.setDocIterator(new Iterator<SolrInputDocument>() {

        //@Override
        public boolean hasNext() {
            return beanIterator.hasNext();
        }

        //@Override
        public SolrInputDocument next() {
            Object o = beanIterator.next();
            if (o == null) {
                return null;
            }
            return getBinder().toSolrInputDocument(o);
        }

        //@Override
        public void remove() {
            beanIterator.remove();
        }
    });
    return req.process(this);
}

From source file:com.su.search.client.solrj.PaHttpSolrServer.java

License:Apache License

/**
 * Adds the beans supplied by the given iterator.
 * /* w  w  w .jav  a  2  s  .com*/
 * @param beanIterator
 *          the iterator which returns Beans
 * 
 * @return the response from the SolrServer
 */
public UpdateResponse addBeans(final Iterator<?> beanIterator) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.setDocIterator(new Iterator<SolrInputDocument>() {

        public boolean hasNext() {
            return beanIterator.hasNext();
        }

        public SolrInputDocument next() {
            Object o = beanIterator.next();
            if (o == null)
                return null;
            return getBinder().toSolrInputDocument(o);
        }

        public void remove() {
            beanIterator.remove();
        }
    });
    return req.process(this);
}

From source file:sk.datalan.solr.impl.HttpSolrServer.java

License:Apache License

/**
 * Adds the beans supplied by the given iterator.
 *
 * @param beanIterator the iterator which returns Beans
 *
 * @return the response from the SolrServer
 *//*w w w  . j a v a  2s.  co m*/
public UpdateResponse addBeans(final Iterator<?> beanIterator) throws SolrServerException, IOException {
    UpdateRequest req = new UpdateRequest();
    req.setDocIterator(new Iterator<SolrInputDocument>() {

        @Override
        public boolean hasNext() {
            return beanIterator.hasNext();
        }

        @Override
        public SolrInputDocument next() {
            Object o = beanIterator.next();
            if (o == null) {
                return null;
            }
            return getBinder().toSolrInputDocument(o);
        }

        @Override
        public void remove() {
            beanIterator.remove();
        }
    });
    return req.process(this);
}