for (MetadataCategory category : fullMd.getCategories()) {
moreFields.add(SearchManager.makeField("_cat", category.getName(), true, true));
}
final MetadataStatusRepository statusRepository = _applicationContext.getBean(MetadataStatusRepository.class);
// get status
Sort statusSort = new Sort(Sort.Direction.DESC, MetadataStatus_.id.getName() + "." + MetadataStatusId_.changeDate.getName());
List<MetadataStatus> statuses = statusRepository.findAllById_MetadataId(id$, statusSort);
if (!statuses.isEmpty()) {
MetadataStatus stat = statuses.get(0);
String status = String.valueOf(stat.getId().getStatusId());
moreFields.add(SearchManager.makeField("_status", status, true, true));
String statusChangeDate = stat.getId().getChangeDate().getDateAndTime();