diff --git a/Kitodo/src/main/java/org/kitodo/production/services/data/base/SearchService.java b/Kitodo/src/main/java/org/kitodo/production/services/data/base/SearchService.java index 3c53b925253..58fb0094dd0 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/data/base/SearchService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/data/base/SearchService.java @@ -857,7 +857,7 @@ protected List findDistinctValues(QueryBuilder query, String field, bool List distinctValues = new ArrayList<>(); try { TermsAggregationBuilder termsAggregation = AggregationBuilders.terms(field).field(field) - .order(BucketOrder.aggregation("_term", sort)); + .order(BucketOrder.aggregation("_key", sort)); if (size > 0) { termsAggregation.size(Math.toIntExact(size)); }