From d8eb9fcb9c3d4cd4437ed8039fc392666a452d5b Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 2 Jun 2022 20:39:56 -0400 Subject: [PATCH] Search: exclude rows from search index (#50124) (#50132) (cherry picked from commit efca93a3f32a6ee719f8c97835dc1d2210364cc2) Co-authored-by: Ryan McKinley --- pkg/services/searchV2/bluge.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/services/searchV2/bluge.go b/pkg/services/searchV2/bluge.go index ebaf3358dc0..6982db40e79 100644 --- a/pkg/services/searchV2/bluge.go +++ b/pkg/services/searchV2/bluge.go @@ -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()).