Search in sources :

Example 1 with SolrCollection

use of com.odysseusinc.arachne.portal.model.solr.SolrCollection in project ArachneCentralAPI by OHDSI.

the class BaseSolrServiceImpl method indexBySolr.

@Override
public void indexBySolr(final List<? extends SolrEntity> entities) {
    try {
        final Map<SolrCollection, List<SolrEntity>> entitiesGroupByCollection = entities.stream().collect(Collectors.groupingBy(SolrEntity::getCollection));
        entitiesGroupByCollection.forEach((key, value) -> putDocuments(key.getName(), value.stream().map(this::getValuesByEntity).collect(Collectors.toList())));
    } catch (final Exception e) {
        throw new SolrException(e);
    }
}
Also used : SolrCollection(com.odysseusinc.arachne.portal.model.solr.SolrCollection) FieldList(com.odysseusinc.arachne.portal.service.impl.solr.FieldList) LinkedList(java.util.LinkedList) List(java.util.List) SolrException(com.odysseusinc.arachne.portal.model.solr.SolrException) SolrServerException(org.apache.solr.client.solrj.SolrServerException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) SolrException(com.odysseusinc.arachne.portal.model.solr.SolrException)

Aggregations

JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 SolrCollection (com.odysseusinc.arachne.portal.model.solr.SolrCollection)1 SolrException (com.odysseusinc.arachne.portal.model.solr.SolrException)1 FieldList (com.odysseusinc.arachne.portal.service.impl.solr.FieldList)1 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 SolrServerException (org.apache.solr.client.solrj.SolrServerException)1