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

This commit is contained in:
Ryan McKinley
2022-05-26 17:08:17 -07:00
committed by GitHub
parent 3d8eda0132
commit a641949a05
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))