/** * Adds the documents supplied by the given iterator. * * @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); }
/** * Adds the documents supplied by the given iterator. * * @param collection the Solr collection to add the documents to * @param docIterator * the iterator which returns SolrInputDocument instances * * @return an {@link org.apache.solr.client.solrj.response.UpdateResponse} from the server * * @throws IOException if there is a communication error with the server * @throws SolrServerException if there is an error on the server */ public UpdateResponse add(String collection, Iterator<SolrInputDocument> docIterator) throws SolrServerException, IOException { UpdateRequest req = new UpdateRequest(); req.setDocIterator(docIterator); return req.process(this, collection); }
/** * Adds the documents supplied by the given iterator. * * @param collection the Solr collection to add the documents to * @param docIterator * the iterator which returns SolrInputDocument instances * * @return an {@link org.apache.solr.client.solrj.response.UpdateResponse} from the server * * @throws IOException if there is a communication error with the server * @throws SolrServerException if there is an error on the server */ public UpdateResponse add(String collection, Iterator<SolrInputDocument> docIterator) throws SolrServerException, IOException { UpdateRequest req = new UpdateRequest(); req.setDocIterator(docIterator); return req.process(this, collection); }
/** * Adds the beans supplied by the given iterator. * * @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); } }
throws SolrServerException, IOException { UpdateRequest req = new UpdateRequest(); req.setDocIterator(new Iterator<SolrInputDocument>() {
throws SolrServerException, IOException { UpdateRequest req = new UpdateRequest(); req.setDocIterator(new Iterator<SolrInputDocument>() {