mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
Search: pass the 'explain' flag from the UI and debug paging issues (#51847)
This commit is contained in:
@@ -429,7 +429,8 @@ func doSearchQuery(
|
||||
hasConstraints = true
|
||||
}
|
||||
|
||||
if q.Query == "*" || q.Query == "" {
|
||||
isMatchAllQuery := q.Query == "*" || q.Query == ""
|
||||
if isMatchAllQuery {
|
||||
if !hasConstraints {
|
||||
fullQuery.AddShould(bluge.NewMatchAllQuery())
|
||||
}
|
||||
@@ -600,7 +601,11 @@ func doSearchQuery(
|
||||
}
|
||||
|
||||
if q.Explain {
|
||||
fScore.Append(match.Score)
|
||||
if isMatchAllQuery {
|
||||
fScore.Append(float64(fieldLen + q.From))
|
||||
} else {
|
||||
fScore.Append(match.Score)
|
||||
}
|
||||
if match.Explanation != nil {
|
||||
js, _ := json.Marshal(&match.Explanation)
|
||||
jsb := json.RawMessage(js)
|
||||
|
||||
Reference in New Issue
Block a user