Fix boolean queries

This commit is contained in:
André Duffeck
2023-05-23 15:54:50 +02:00
parent b1bfb93230
commit cfb0152372

View File

@@ -374,9 +374,13 @@ func formatQuery(q string) string {
for _, part := range parts {
fieldParts := strings.SplitN(part, ":", 2)
if len(fieldParts) > 1 {
cq += fieldParts[0] + ":" + strings.ToLower(fieldParts[1]) + " "
value := fieldParts[1]
if value != "T" && value != "F" {
value = strings.ToLower(value) // do a lowercase query unless this is a boolean flag
}
cq += fieldParts[0] + ":" + value + " "
} else {
cq += part
cq += part + " "
}
}
return cq // Sophisticated field based search