SearchV2: improve searcher API, and include a fallback SQL based implementation (#49535) (#49746)

(cherry picked from commit a641949a05)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-05-26 17:30:58 -07:00
committed by GitHub
co-authored by Ryan McKinley
parent 9f3ade9472
commit afa40190d4
13 changed files with 282 additions and 95 deletions
-21
View File
@@ -295,27 +295,6 @@ func doSearchQuery(ctx context.Context, logger log.Logger, reader *bluge.Reader,
response := &backend.DataResponse{}
header := &customMeta{}
// Folder listing structure.
idx := strings.Index(q.Query, ":")
if idx > 0 {
key := q.Query[0:idx]
val := q.Query[idx+1:]
if key == "list" {
q.Limit = 1000
q.Query = ""
q.Location = ""
q.Explain = false
q.SkipLocation = true
q.Facet = nil
if val == "root" || val == "" {
q.Kind = []string{string(entityKindFolder)}
} else {
q.Location = val
q.Kind = []string{string(entityKindDashboard)}
}
}
}
hasConstraints := false
fullQuery := bluge.NewBooleanQuery()
fullQuery.AddMust(newPermissionFilter(filter, logger))