Merge branch 'fix/smart-search-scope-uppercase' into 'main'

fix(search): scope filter uppercase — fixes Smart Search 0 results (BUG-005)

See merge request 2-6/2-6-4/terravault/ordinis!228
This commit is contained in:
Александр Зимин
2026-05-15 19:52:24 +00:00
@@ -52,11 +52,12 @@ public class SearchController {
@RequestParam String q,
@RequestParam(defaultValue = "100") int size,
@RequestParam(defaultValue = "10") int perDict) {
// DB column data_scope использует UPPERCASE per migrations 0008/0009 CHECK
// constraint (PUBLIC/INTERNAL/RESTRICTED). Раньше был .toLowerCase() с
// неверным комментарием — все search queries возвращали 0 (filter
// 'public' не матчил 'PUBLIC'). QA report BUG-005.
var scopeStrings = scopeContext.currentScopes().stream()
.map(DataScope::name)
// DB column data_scope использует lowercase per CHECK constraint
// ("public"/"internal"/"restricted"). Mapping enum → lowercase.
.map(String::toLowerCase)
.collect(Collectors.toList());
List<RecordSearchQuery.SearchHit> hits = searchQuery.search(