Search in sources :

Example 1 with SolrDocumentPopulator

use of eu.europeana.indexing.solr.SolrDocumentPopulator in project metis-framework by europeana.

the class FullBeanPublisher method publishToSolr.

private void publishToSolr(RdfWrapper rdf, FullBeanImpl fullBean) throws IndexingException {
    // Create Solr document.
    final SolrDocumentPopulator documentPopulator = new SolrDocumentPopulator();
    final SolrInputDocument document = new SolrInputDocument();
    documentPopulator.populateWithProperties(document, fullBean);
    documentPopulator.populateWithFacets(document, rdf);
    // Save Solr document.
    try {
        solrServer.add(document);
    } catch (IOException e) {
        throw new IndexerRelatedIndexingException(SOLR_SERVER_PUBLISH_ERROR, e);
    } catch (SolrServerException | RuntimeException e) {
        throw new RecordRelatedIndexingException(SOLR_SERVER_PUBLISH_ERROR, e);
    }
}
Also used : SolrInputDocument(org.apache.solr.common.SolrInputDocument) SolrDocumentPopulator(eu.europeana.indexing.solr.SolrDocumentPopulator) SolrServerException(org.apache.solr.client.solrj.SolrServerException) IndexerRelatedIndexingException(eu.europeana.indexing.exception.IndexerRelatedIndexingException) RecordRelatedIndexingException(eu.europeana.indexing.exception.RecordRelatedIndexingException) IOException(java.io.IOException)

Aggregations

IndexerRelatedIndexingException (eu.europeana.indexing.exception.IndexerRelatedIndexingException)1 RecordRelatedIndexingException (eu.europeana.indexing.exception.RecordRelatedIndexingException)1 SolrDocumentPopulator (eu.europeana.indexing.solr.SolrDocumentPopulator)1 IOException (java.io.IOException)1 SolrServerException (org.apache.solr.client.solrj.SolrServerException)1 SolrInputDocument (org.apache.solr.common.SolrInputDocument)1