/** * Commits the batch of newly-processed documents. */ protected void commitTerms(Collection<SolrInputDocument> batch) throws SolrServerException, IOException, OutOfMemoryError { this.externalServicesAccess.getReplacementSolrConnection(this).add(batch); this.externalServicesAccess.getReplacementSolrConnection(this).commit(); }
/** * Sets the ontology version data. * * @param doc the Solr input document * @param ontModel the ontology model * @throws IOException if failed to communicate with Solr server while indexing ontology * @throws SolrServerException if failed to index ontology */ private void setVersion(@Nonnull final SolrInputDocument doc, @Nonnull final OntModel ontModel) throws IOException, SolrServerException { final String version = ontModel.getOntology(getBaseOntologyUri()).getVersionInfo(); if (StringUtils.isNotBlank(version)) { doc.addField(ID_FIELD_NAME, HEADER_INFO_LABEL); doc.addField(VERSION_FIELD_NAME, version); this.externalServicesAccess.getReplacementSolrConnection(this).add(doc); doc.clear(); } }