mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: exclude rows from search index (#50124)
This commit is contained in:
parent
d3c6c2ed94
commit
efca93a3f3
@ -186,12 +186,13 @@ func getDashboardPanelDocs(dash dashboard, location string) []*bluge.Document {
|
|||||||
var docs []*bluge.Document
|
var docs []*bluge.Document
|
||||||
url := fmt.Sprintf("/d/%s/%s", dash.uid, dash.slug)
|
url := fmt.Sprintf("/d/%s/%s", dash.uid, dash.slug)
|
||||||
for _, panel := range dash.info.Panels {
|
for _, panel := range dash.info.Panels {
|
||||||
uid := dash.uid + "#" + strconv.FormatInt(panel.ID, 10)
|
if panel.Type == "row" {
|
||||||
purl := url
|
continue // for now, we are excluding rows from the search index
|
||||||
if panel.Type != "row" {
|
|
||||||
purl = fmt.Sprintf("%s?viewPanel=%d", url, panel.ID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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).
|
doc := newSearchDocument(uid, panel.Title, panel.Description, purl).
|
||||||
AddField(bluge.NewKeywordField(documentFieldDSUID, dash.uid).StoreValue()).
|
AddField(bluge.NewKeywordField(documentFieldDSUID, dash.uid).StoreValue()).
|
||||||
AddField(bluge.NewKeywordField(documentFieldPanelType, panel.Type).Aggregatable().StoreValue()).
|
AddField(bluge.NewKeywordField(documentFieldPanelType, panel.Type).Aggregatable().StoreValue()).
|
||||||
|
Loading…
Reference in New Issue
Block a user