mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 18:23:50 +08:00
Unified Storage: Fix search case sensitivity (#99603)
lowercase search query when doing a text query. Doing this makes the NewWildcardQuery be case-insensitive
This commit is contained in:
@ -575,7 +575,7 @@ func (b *bleveIndex) toBleveSearchRequest(ctx context.Context, req *resource.Res
|
||||
if req.Query != "" && req.Query != "*" {
|
||||
searchrequest.Fields = append(searchrequest.Fields, resource.SEARCH_FIELD_SCORE)
|
||||
// mimic the behavior of the sql search
|
||||
query := req.Query
|
||||
query := strings.ToLower(req.Query)
|
||||
if !strings.Contains(query, "*") {
|
||||
query = "*" + query + "*"
|
||||
}
|
||||
|
Reference in New Issue
Block a user