From 796e5fd373c9a96f6be7b67aa59b0b7734e43f74 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Mon, 20 Apr 2026 16:40:55 +0200 Subject: [PATCH] fix(search): tighten lowercaseFields comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot review pointed out that the comment claimed pre-lowercasing makes non-analyzed query types (wildcard, fuzzy) match for every allowlisted field. That is true for Name/Tags/Favorites, whose lowercaseKeyword analyzer emits a single lowercased token, but the Content analyzer also stems terms — so the guarantee doesn't hold there. Drop the specific claim and keep the comment to the intent: stay consistent with the field's analyzer. --- services/search/pkg/query/bleve/compiler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/search/pkg/query/bleve/compiler.go b/services/search/pkg/query/bleve/compiler.go index f5d58997ad..2d3130c397 100644 --- a/services/search/pkg/query/bleve/compiler.go +++ b/services/search/pkg/query/bleve/compiler.go @@ -10,9 +10,9 @@ import ( "github.com/opencloud-eu/opencloud/pkg/kql" ) -// lowercaseFields lists the bleve fields whose index mapping uses a lowercasing analyzer. -// Values bound to these fields are pre-lowercased so that non-analyzed query types -// (e.g. wildcard, fuzzy) still match the lowercased terms in the index. +// lowercaseFields lists the bleve fields whose index mapping uses a +// lowercasing analyzer. Values bound to these fields are pre-lowercased +// so query-side matching stays consistent with the index. // Keep in sync with services/search/pkg/bleve/index.go NewMapping. var lowercaseFields = map[string]bool{ "Name": true,