@Override public DocumentObjectBinder getBinder() { return solrServer.getBinder(); }
@Override public SolrInputDocument next() { Object o = beanIterator.next(); if (o == null) return null; return getBinder().toSolrInputDocument(o); }
@Override public SolrInputDocument next() { Object o = beanIterator.next(); if (o == null) return null; return getBinder().toSolrInputDocument(o); }
@Override public DocumentObjectBinder getBinder() { return solrServer.getBinder(); }
@Override public DocumentObjectBinder getBinder() { return solrServer.getBinder(); }
/** * Adds a collection of beans specifying max time before they become committed * * The beans are converted to {@link SolrInputDocument}s by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param collection the Solr collection to add documents to * @param beans the collection of beans * @param commitWithinMs max time (in ms) before a commit will happen * * @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 * * @see SolrClient#getBinder() * * @since solr 5.1 */ public UpdateResponse addBeans(String collection, Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException { DocumentObjectBinder binder = this.getBinder(); ArrayList<SolrInputDocument> docs = new ArrayList<>(beans.size()); for (Object bean : beans) { docs.add(binder.toSolrInputDocument(bean)); } return add(collection, docs, commitWithinMs); }
/** * Adds a single bean specifying max time before it becomes committed * * The bean is converted to a {@link SolrInputDocument} by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param obj the input bean * * @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 addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException { return add(null, getBinder().toSolrInputDocument(obj), commitWithinMs); }
/** * Adds a single bean specifying max time before it becomes committed * * The bean is converted to a {@link SolrInputDocument} by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param collection to Solr collection to add documents to * @param obj the input bean * * @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 addBean(String collection, Object obj, int commitWithinMs) throws IOException, SolrServerException { return add(collection, getBinder().toSolrInputDocument(obj), commitWithinMs); }
/** * Adds a single bean specifying max time before it becomes committed * * The bean is converted to a {@link SolrInputDocument} by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param obj the input bean * * @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 addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException { return add(null, getBinder().toSolrInputDocument(obj), commitWithinMs); }
/** * Adds a collection of beans specifying max time before they become committed * * The beans are converted to {@link SolrInputDocument}s by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param collection the Solr collection to add documents to * @param beans the collection of beans * @param commitWithinMs max time (in ms) before a commit will happen * * @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 * * @see SolrClient#getBinder() * * @since solr 5.1 */ public UpdateResponse addBeans(String collection, Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException { DocumentObjectBinder binder = this.getBinder(); ArrayList<SolrInputDocument> docs = new ArrayList<>(beans.size()); for (Object bean : beans) { docs.add(binder.toSolrInputDocument(bean)); } return add(collection, docs, commitWithinMs); }
/** * Adds a single bean specifying max time before it becomes committed * * The bean is converted to a {@link SolrInputDocument} by the client's * {@link org.apache.solr.client.solrj.beans.DocumentObjectBinder} * * @param collection to Solr collection to add documents to * @param obj the input bean * * @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 addBean(String collection, Object obj, int commitWithinMs) throws IOException, SolrServerException { return add(collection, getBinder().toSolrInputDocument(obj), commitWithinMs); }
public <T> List<T> getBeans(Class<T> type){ return solrClient == null ? new DocumentObjectBinder().getBeans(type,_results): solrClient.getBinder().getBeans(type, _results); }
public <T> List<T> getBeans(Class<T> type){ return solrClient == null ? new DocumentObjectBinder().getBeans(type,_results): solrClient.getBinder().getBeans(type, _results); }
total += gCommand.getNGroups(); for (Group group : gCommand.getValues()) { docs.addAll(server.getBinder().getBeans(Document.class, group.getResult()));
@Test public void testGetBinder() throws Exception { RetryingSolrServer retryingSolr = new RetryingSolrServer(solrServer, getNoRetryPolicyFactory(), getMetricsFacade()); assertSame(solrServer.getBinder(), retryingSolr.getBinder()); }