fix(search): tighten lowercaseFields comment

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.
This commit is contained in:
Dominik Schmidt
2026-04-20 16:40:55 +02:00
parent 538c82787c
commit 796e5fd373

View File

@@ -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,