mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-24 16:41:35 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user