Search: exclude rows from search index (#50124) (#50132)

(cherry picked from commit efca93a3f3)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-06-03 02:39:56 +02:00
committed by GitHub
co-authored by Ryan McKinley
parent afec2786fc
commit d8eb9fcb9c
+5 -4
View File
@@ -186,12 +186,13 @@ func getDashboardPanelDocs(dash dashboard, location string) []*bluge.Document {
var docs []*bluge.Document
url := fmt.Sprintf("/d/%s/%s", dash.uid, dash.slug)
for _, panel := range dash.info.Panels {
uid := dash.uid + "#" + strconv.FormatInt(panel.ID, 10)
purl := url
if panel.Type != "row" {
purl = fmt.Sprintf("%s?viewPanel=%d", url, panel.ID)
if panel.Type == "row" {
continue // for now, we are excluding rows from the search index
}
uid := dash.uid + "#" + strconv.FormatInt(panel.ID, 10)
purl := fmt.Sprintf("%s?viewPanel=%d", url, panel.ID)
doc := newSearchDocument(uid, panel.Title, panel.Description, purl).
AddField(bluge.NewKeywordField(documentFieldDSUID, dash.uid).StoreValue()).
AddField(bluge.NewKeywordField(documentFieldPanelType, panel.Type).Aggregatable().StoreValue()).