use of com.odysseusinc.arachne.portal.api.v1.dto.BreadcrumbDTO in project ArachneCentralAPI by OHDSI.
the class BaseSolrServiceImpl method addBreadcrumbsIfNeeded.
private void addBreadcrumbsIfNeeded(final Object entity, final Map<T, Object> values) {
if (entity instanceof Breadcrumb) {
final Breadcrumb bc = (Breadcrumb) entity;
try {
final List<BreadcrumbDTO> breadcrumbs = breadcrumbService.getBreadcrumbs(bc).stream().map(v -> conversionService.convert(v, BreadcrumbDTO.class)).collect(Collectors.toList());
final T field = newSolrField(BREADCRUMBS);
field.setPostfixNeeded(Boolean.FALSE);
field.setSearchable(Boolean.FALSE);
values.put(field, objectMapper.writeValueAsString(breadcrumbs));
} catch (final JsonProcessingException e) {
throw new UnsupportedOperationException(e);
}
}
}
Aggregations