From c079c0adb4200e64dd99392d83823c3b0ea06f59 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 4 Sep 2024 12:30:00 +0200 Subject: [PATCH] Preserve order of suggestions search results (#2065) Use ordered list (`toList`), not unordered set (`toSet`) --- web/app/controllers/resources/Application.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/controllers/resources/Application.java b/web/app/controllers/resources/Application.java index 15f085610..e11446e33 100644 --- a/web/app/controllers/resources/Application.java +++ b/web/app/controllers/resources/Application.java @@ -394,7 +394,7 @@ private static JsonNode toSuggestions(JsonNode json, String field) { : typeText)); }); }); - return Json.toJson(suggestions.collect(Collectors.toSet())); + return Json.toJson(suggestions.collect(Collectors.toList())); } private static Stream fieldValues(String field, JsonNode document) {