public void addDocs(SolrServer server) throws IOException, SolrServerException { ... server.add(doc); }
public void flushBuffer() throws SolrServerException, IOException { if (buffer.size() > 0) { coreUpdateServer.add(buffer); buffer.clear(); } }
private void loadBatch() throws SolrServerException, IOException { numLoadedDocs += batch.size(); try { UpdateResponse rsp = server.add(batch); } finally { batch.clear(); } }
private void sendLoads(List<SolrInputDocument> loads) throws SolrServerException, IOException { if (loads.size() > 0) { log(server.add(loads)); loads.clear(); } }
public Object run() throws IOException, SolrServerException { server.add(inputDoc); if(commit){ server.commit(); } return null; } });
public Object run() throws IOException, SolrServerException { server.add(inputDoc); if(commit){ server.commit(); } return null; } });
public UpdateResponse addBeans(Collection<?> beans ) throws SolrServerException, IOException { DocumentObjectBinder binder = this.getBinder(); ArrayList<SolrInputDocument> docs = new ArrayList<SolrInputDocument>(beans.size()); for (Object bean : beans) { docs.add(binder.toSolrInputDocument(bean)); } return add(docs); }
public UpdateResponse addBean(Object obj) throws IOException, SolrServerException { return add(getBinder().toSolrInputDocument(obj)); }
SolrServer server = new CommonsHttpSolrServer(url); SolrInputDocument document = new SolrInputDocument(); document.addField("tint", 1); server.add(document); server.commit();
@Override public void process(SolrDocument doc) throws IOException, SolrServerException { doc.removeFields("isBot"); doc.addField("isBot", true); SolrInputDocument newInput = ClientUtils.toSolrInputDocument(doc); solr.add(newInput); log.info("Marked " + doc.getFieldValue("ip") + " as bot"); } };
@Override public void process(SolrDocument doc) throws IOException, SolrServerException { doc.removeFields("isBot"); doc.addField("isBot", true); SolrInputDocument newInput = ClientUtils.toSolrInputDocument(doc); solr.add(newInput); } };
private void addSolrDocument(String line, int retriesLeft) throws IOException { try { SolrInputDocument inputDocument = converter.toSolrDocument(line); solrServer.add(inputDocument); } catch (SolrServerException e) { handleAddDocumentException( e, line, retriesLeft ); } catch (SolrException e) { handleAddDocumentException( e, line, retriesLeft ); } }
@Override public void addTerms(List<ThesaurusTerm> thesaurusTerms) { try { for (ThesaurusTerm term : thesaurusTerms) { logger.info("Indexing term :" + term.getIdentifier()); SolrInputDocument doc = termSolrConverter.convertSolrTerm(term); solrServer.add(doc); } solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException("Error during adding to SOLR!", e); } catch (IOException e) { throw new TechnicalException("IO error!", e); } }
protected void commitTerms(Collection<SolrInputDocument> batch) throws SolrServerException, IOException, OutOfMemoryError { this.externalServicesAccess.getServer().add(batch); this.externalServicesAccess.getServer().commit(); this.externalServicesAccess.getCache().removeAll(); }
SolrServer server = new HttpSolrServer("http://localhost:8983/solr/CORE_NAME/"); SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", "1"); doc.addField("Name", "John"); doc.addField("RollNo", "101"); server.add(doc); UpdateResponse updateResponse = server.commit(); System.out.println(updateResponse.getStatus());
String urlString = "http://localhost:8983/solr"; SolrServer solr = new HttpSolrServer(urlString); SolrInputDocument document = new SolrInputDocument(); document.addField("id", "552199"); document.addField("name", "Gouda cheese wheel"); document.addField("price", "49.99"); UpdateResponse response = solr.add(document); // Remember to commit your changes! solr.commit();
@Override public void addNotes(List<Note> notes) { try { for (Note note : notes) { logger.info("Indexing note :" + note.getIdentifier()); if (note.getTerm() != null || note.getConcept() != null) { SolrInputDocument doc = noteSolrConverter.convertSolrNote(note); solrServer.add(doc); } } solrServer.commit(); } catch (SolrServerException e) { throw new TechnicalException("Error during adding to SOLR!", e); } catch (IOException e) { throw new TechnicalException("IO error!", e); } }
private void addSolrDocument(String line, int retriesLeft) throws IOException { try { SolrInputDocument inputDocument = converter.toSolrDocument(line); solrServer.add(inputDocument); } catch (SolrServerException e) { handleAddDocumentException( e, line, retriesLeft ); } catch (SolrException e) { handleAddDocumentException( e, line, retriesLeft ); } catch (IllegalFieldException e) { handleAddDocumentException( e, line, retriesLeft ); } catch (IllegalColumnException e) { handleAddDocumentException( e, line, retriesLeft ); } catch (IllegalRowException e) { handleAddDocumentException( e, line, retriesLeft ); } }