fix(search): fix mutating query state fields

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-07-07 15:42:19 +01:00
parent df5e6d92a6
commit 81a1ce601c
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -149,15 +149,16 @@ func formatQualifiers(qs Qualifiers) []string {
}
func formatKeywords(ks []string) []string {
result := make([]string, len(ks))
for i, k := range ks {
before, after, found := strings.Cut(k, ":")
if !found {
ks[i] = quote(k)
result[i] = quote(k)
} else {
ks[i] = fmt.Sprintf("%s:%s", before, quote(after))
result[i] = fmt.Sprintf("%s:%s", before, quote(after))
}
}
return ks
return result
}
// CamelToKebab returns a copy of the string s that is converted from camel case form to '-' separated form.