Search: exclude rows from search index (#50124)

This commit is contained in:
Ryan McKinley 2022-06-02 17:29:14 -07:00 committed by GitHub
parent d3c6c2ed94
commit efca93a3f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()).