diff --git a/pkg/services/searchV2/bluge.go b/pkg/services/searchV2/bluge.go index 79f7d52ea4a..af2d048e940 100644 --- a/pkg/services/searchV2/bluge.go +++ b/pkg/services/searchV2/bluge.go @@ -9,9 +9,6 @@ import ( "time" "github.com/blugelabs/bluge" - "github.com/blugelabs/bluge/analysis" - "github.com/blugelabs/bluge/analysis/token" - "github.com/blugelabs/bluge/analysis/tokenizer" "github.com/blugelabs/bluge/search" "github.com/blugelabs/bluge/search/aggregations" "github.com/grafana/grafana-plugin-sdk-go/backend" @@ -218,23 +215,6 @@ func getDashboardPanelDocs(dash dashboard, location string) []*bluge.Document { return docs } -const ngramEdgeFilterMaxLength = 7 - -var ngramIndexAnalyzer = &analysis.Analyzer{ - Tokenizer: tokenizer.NewWhitespaceTokenizer(), - TokenFilters: []analysis.TokenFilter{ - token.NewLowerCaseFilter(), - token.NewEdgeNgramFilter(token.FRONT, 1, ngramEdgeFilterMaxLength), - }, -} - -var ngramQueryAnalyzer = &analysis.Analyzer{ - Tokenizer: tokenizer.NewWhitespaceTokenizer(), - TokenFilters: []analysis.TokenFilter{ - token.NewLowerCaseFilter(), - }, -} - // Names need to be indexed a few ways to support key features func newSearchDocument(uid string, name string, descr string, url string) *bluge.Document { doc := bluge.NewDocument(uid) @@ -419,10 +399,11 @@ func doSearchQuery( } else { // The actual se bq := bluge.NewBooleanQuery(). - AddShould(bluge.NewMatchPhraseQuery(q.Query).SetField(documentFieldName).SetBoost(6)). - AddShould(bluge.NewMatchPhraseQuery(q.Query).SetField(documentFieldDescription).SetBoost(3)). + AddShould(bluge.NewMatchQuery(q.Query).SetField(documentFieldName).SetBoost(6)). + AddShould(bluge.NewMatchQuery(q.Query).SetField(documentFieldDescription).SetBoost(3)). AddShould(bluge.NewMatchQuery(q.Query). SetField(documentFieldName_ngram). + SetOperator(bluge.MatchQueryOperatorAnd). // all terms must match SetAnalyzer(ngramQueryAnalyzer).SetBoost(1)) if len(q.Query) > 4 { diff --git a/pkg/services/searchV2/index_test.go b/pkg/services/searchV2/index_test.go index 5692523a1e0..bd5c1d513a2 100644 --- a/pkg/services/searchV2/index_test.go +++ b/pkg/services/searchV2/index_test.go @@ -250,14 +250,14 @@ var testPrefixDashboards = []dashboard{ id: 1, uid: "1", info: &extract.DashboardInfo{ - Title: "Archer Data", + Title: "Archer Data System", }, }, { id: 2, uid: "2", info: &extract.DashboardInfo{ - Title: "Document Sync", + Title: "Document Sync repo", }, }, } @@ -303,21 +303,22 @@ func TestDashboardIndex_MultipleTokensInRow(t *testing.T) { t.Run("multiple-tokens-beginning-lower", func(t *testing.T) { _, reader, _ := initTestIndexFromDashes(t, testPrefixDashboards) checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, - DashboardQuery{Query: "archer da"}, + DashboardQuery{Query: "da archer"}, ) }) + // Not sure it is great this matches, but t.Run("multiple-tokens-middle", func(t *testing.T) { _, reader, _ := initTestIndexFromDashes(t, testPrefixDashboards) checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, - DashboardQuery{Query: "rcher Da"}, + DashboardQuery{Query: "ar Da"}, ) }) t.Run("multiple-tokens-middle-lower", func(t *testing.T) { _, reader, _ := initTestIndexFromDashes(t, testPrefixDashboards) checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, - DashboardQuery{Query: "cument sy"}, + DashboardQuery{Query: "doc sy"}, ) }) } @@ -511,3 +512,55 @@ func TestDashboardIndex_Panels(t *testing.T) { ) }) } + +var punctuationSplitNgramDashboards = []dashboard{ + { + id: 1, + uid: "1", + info: &extract.DashboardInfo{ + Title: "heat-torkel", + }, + }, + { + id: 2, + uid: "2", + info: &extract.DashboardInfo{ + Title: "topology heatmap", + }, + }, +} + +func TestDashboardIndex_PunctuationNgram(t *testing.T) { + t.Run("ngram-punctuation-split", func(t *testing.T) { + _, reader, _ := initTestIndexFromDashes(t, punctuationSplitNgramDashboards) + checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, + DashboardQuery{Query: "tork he"}, + ) + }) + + t.Run("ngram-simple", func(t *testing.T) { + _, reader, _ := initTestIndexFromDashes(t, punctuationSplitNgramDashboards) + checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, + DashboardQuery{Query: "hea"}, + ) + }) +} + +var camelCaseNgramDashboards = []dashboard{ + { + id: 1, + uid: "1", + info: &extract.DashboardInfo{ + Title: "heatTorkel", + }, + }, +} + +func TestDashboardIndex_CamelCaseNgram(t *testing.T) { + t.Run("ngram-camel-case-split", func(t *testing.T) { + _, reader, _ := initTestIndexFromDashes(t, camelCaseNgramDashboards) + checkSearchResponse(t, filepath.Base(t.Name()), reader, testAllowAllFilter, + DashboardQuery{Query: "tork"}, + ) + }) +} diff --git a/pkg/services/searchV2/ngram.go b/pkg/services/searchV2/ngram.go new file mode 100644 index 00000000000..48c1e56fafb --- /dev/null +++ b/pkg/services/searchV2/ngram.go @@ -0,0 +1,47 @@ +package searchV2 + +import ( + "strings" + + "github.com/blugelabs/bluge/analysis" + "github.com/blugelabs/bluge/analysis/token" + "github.com/blugelabs/bluge/analysis/tokenizer" +) + +var punctuationReplacer *strings.Replacer + +func init() { + var punctuation = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" + args := make([]string, 0, len(punctuation)*2) + for _, r := range punctuation { + args = append(args, string(r), " ") + } + punctuationReplacer = strings.NewReplacer(args...) +} + +type punctuationCharFilter struct{} + +func (t *punctuationCharFilter) Filter(input []byte) []byte { + return []byte(punctuationReplacer.Replace(string(input))) +} + +const ngramEdgeFilterMaxLength = 7 + +var ngramIndexAnalyzer = &analysis.Analyzer{ + CharFilters: []analysis.CharFilter{&punctuationCharFilter{}}, + Tokenizer: tokenizer.NewWhitespaceTokenizer(), + TokenFilters: []analysis.TokenFilter{ + token.NewCamelCaseFilter(), + token.NewLowerCaseFilter(), + token.NewEdgeNgramFilter(token.FRONT, 1, ngramEdgeFilterMaxLength), + }, +} + +var ngramQueryAnalyzer = &analysis.Analyzer{ + CharFilters: []analysis.CharFilter{&punctuationCharFilter{}}, + Tokenizer: tokenizer.NewWhitespaceTokenizer(), + TokenFilters: []analysis.TokenFilter{ + token.NewCamelCaseFilter(), + token.NewLowerCaseFilter(), + }, +} diff --git a/pkg/services/searchV2/ngram_test.go b/pkg/services/searchV2/ngram_test.go new file mode 100644 index 00000000000..be2d6646e9e --- /dev/null +++ b/pkg/services/searchV2/ngram_test.go @@ -0,0 +1,59 @@ +package searchV2 + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_punctuationCharFilter_Filter(t1 *testing.T) { + type args struct { + input []byte + } + tests := []struct { + name string + args args + want []byte + }{ + { + name: "1", + args: args{ + input: []byte("x-Rays"), + }, + want: []byte("x Rays"), + }, + { + name: "2", + args: args{ + input: []byte("x.Rays"), + }, + want: []byte("x Rays"), + }, + { + name: "3", + args: args{ + input: []byte("[x,Rays]"), + }, + want: []byte(" x Rays "), + }, + } + for _, tt := range tests { + t1.Run(tt.name, func(t1 *testing.T) { + t := &punctuationCharFilter{} + if got := t.Filter(tt.args.input); !reflect.DeepEqual(got, tt.want) { + t1.Errorf("Filter() = %v, want %v", string(got), string(tt.want)) + } + }) + } +} + +func TestNgramIndexAnalyzer(t *testing.T) { + stream := ngramIndexAnalyzer.Analyze([]byte("x-rays.and.xRays, and НемногоКириллицы")) + expectedTerms := []string{"x", "r", "ra", "ray", "rays", "a", "an", "and", "x", "r", "ra", "ray", "rays", "a", "an", "and", "н", "не", "нем", "немн", "немно", "немног", "немного", "к", "ки", "кир", "кири", "кирил", "кирилл", "кирилли"} + var actualTerms []string + for _, t := range stream { + actualTerms = append(actualTerms, string(t.Term)) + } + require.Equal(t, expectedTerms, actualTerms) +} diff --git a/pkg/services/searchV2/testdata/multiple-tokens-beginning-lower.jsonc b/pkg/services/searchV2/testdata/multiple-tokens-beginning-lower.jsonc index 022b5a15649..8831219a6bd 100644 --- a/pkg/services/searchV2/testdata/multiple-tokens-beginning-lower.jsonc +++ b/pkg/services/searchV2/testdata/multiple-tokens-beginning-lower.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 1 | Archer Data | | /pfix/d/1/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | Archer Data System | | /pfix/d/1/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "1" ], [ - "Archer Data" + "Archer Data System" ], [ "" diff --git a/pkg/services/searchV2/testdata/multiple-tokens-beginning.jsonc b/pkg/services/searchV2/testdata/multiple-tokens-beginning.jsonc index 022b5a15649..8831219a6bd 100644 --- a/pkg/services/searchV2/testdata/multiple-tokens-beginning.jsonc +++ b/pkg/services/searchV2/testdata/multiple-tokens-beginning.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 1 | Archer Data | | /pfix/d/1/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | Archer Data System | | /pfix/d/1/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "1" ], [ - "Archer Data" + "Archer Data System" ], [ "" diff --git a/pkg/services/searchV2/testdata/multiple-tokens-middle-lower.jsonc b/pkg/services/searchV2/testdata/multiple-tokens-middle-lower.jsonc index 2db59e343f8..2fe14bb9129 100644 --- a/pkg/services/searchV2/testdata/multiple-tokens-middle-lower.jsonc +++ b/pkg/services/searchV2/testdata/multiple-tokens-middle-lower.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 2 | Document Sync | | /pfix/d/2/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 2 | Document Sync repo | | /pfix/d/2/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "2" ], [ - "Document Sync" + "Document Sync repo" ], [ "" diff --git a/pkg/services/searchV2/testdata/multiple-tokens-middle.jsonc b/pkg/services/searchV2/testdata/multiple-tokens-middle.jsonc index 022b5a15649..8831219a6bd 100644 --- a/pkg/services/searchV2/testdata/multiple-tokens-middle.jsonc +++ b/pkg/services/searchV2/testdata/multiple-tokens-middle.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 1 | Archer Data | | /pfix/d/1/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | Archer Data System | | /pfix/d/1/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "1" ], [ - "Archer Data" + "Archer Data System" ], [ "" diff --git a/pkg/services/searchV2/testdata/ngram-camel-case-split.jsonc b/pkg/services/searchV2/testdata/ngram-camel-case-split.jsonc new file mode 100644 index 00000000000..f7c18e0f055 --- /dev/null +++ b/pkg/services/searchV2/testdata/ngram-camel-case-split.jsonc @@ -0,0 +1,131 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "type": "search-results", +// "custom": { +// "count": 1 +// } +// } +// Name: Query results +// Dimensions: 8 Fields by 1 Rows +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | heatTorkel | | /pfix/d/1/ | null | null | | +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "frames": [ + { + "schema": { + "name": "Query results", + "meta": { + "type": "search-results", + "custom": { + "count": 1 + } + }, + "fields": [ + { + "name": "kind", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "uid", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "name", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "panel_type", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "url", + "type": "string", + "typeInfo": { + "frame": "string" + }, + "config": { + "links": [ + { + "title": "link", + "url": "${__value.text}" + } + ] + } + }, + { + "name": "tags", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "ds_uid", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "location", + "type": "string", + "typeInfo": { + "frame": "string" + } + } + ] + }, + "data": { + "values": [ + [ + "dashboard" + ], + [ + "1" + ], + [ + "heatTorkel" + ], + [ + "" + ], + [ + "/pfix/d/1/" + ], + [ + null + ], + [ + null + ], + [ + "" + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/pkg/services/searchV2/testdata/ngram-punctuation-split.jsonc b/pkg/services/searchV2/testdata/ngram-punctuation-split.jsonc new file mode 100644 index 00000000000..4433aa0c09b --- /dev/null +++ b/pkg/services/searchV2/testdata/ngram-punctuation-split.jsonc @@ -0,0 +1,131 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "type": "search-results", +// "custom": { +// "count": 1 +// } +// } +// Name: Query results +// Dimensions: 8 Fields by 1 Rows +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | heat-torkel | | /pfix/d/1/ | null | null | | +// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "frames": [ + { + "schema": { + "name": "Query results", + "meta": { + "type": "search-results", + "custom": { + "count": 1 + } + }, + "fields": [ + { + "name": "kind", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "uid", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "name", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "panel_type", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "url", + "type": "string", + "typeInfo": { + "frame": "string" + }, + "config": { + "links": [ + { + "title": "link", + "url": "${__value.text}" + } + ] + } + }, + { + "name": "tags", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "ds_uid", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "location", + "type": "string", + "typeInfo": { + "frame": "string" + } + } + ] + }, + "data": { + "values": [ + [ + "dashboard" + ], + [ + "1" + ], + [ + "heat-torkel" + ], + [ + "" + ], + [ + "/pfix/d/1/" + ], + [ + null + ], + [ + null + ], + [ + "" + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/pkg/services/searchV2/testdata/ngram-simple.jsonc b/pkg/services/searchV2/testdata/ngram-simple.jsonc new file mode 100644 index 00000000000..65b27bc0727 --- /dev/null +++ b/pkg/services/searchV2/testdata/ngram-simple.jsonc @@ -0,0 +1,140 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "type": "search-results", +// "custom": { +// "count": 2 +// } +// } +// Name: Query results +// Dimensions: 8 Fields by 2 Rows +// +----------------+----------------+------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | heat-torkel | | /pfix/d/1/ | null | null | | +// | dashboard | 2 | topology heatmap | | /pfix/d/2/ | null | null | | +// +----------------+----------------+------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "frames": [ + { + "schema": { + "name": "Query results", + "meta": { + "type": "search-results", + "custom": { + "count": 2 + } + }, + "fields": [ + { + "name": "kind", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "uid", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "name", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "panel_type", + "type": "string", + "typeInfo": { + "frame": "string" + } + }, + { + "name": "url", + "type": "string", + "typeInfo": { + "frame": "string" + }, + "config": { + "links": [ + { + "title": "link", + "url": "${__value.text}" + } + ] + } + }, + { + "name": "tags", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "ds_uid", + "type": "other", + "typeInfo": { + "frame": "json.RawMessage", + "nullable": true + } + }, + { + "name": "location", + "type": "string", + "typeInfo": { + "frame": "string" + } + } + ] + }, + "data": { + "values": [ + [ + "dashboard", + "dashboard" + ], + [ + "1", + "2" + ], + [ + "heat-torkel", + "topology heatmap" + ], + [ + "", + "" + ], + [ + "/pfix/d/1/", + "/pfix/d/2/" + ], + [ + null, + null + ], + [ + null, + null + ], + [ + "", + "" + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/pkg/services/searchV2/testdata/prefix-search-beginning-lower.jsonc b/pkg/services/searchV2/testdata/prefix-search-beginning-lower.jsonc index 022b5a15649..8831219a6bd 100644 --- a/pkg/services/searchV2/testdata/prefix-search-beginning-lower.jsonc +++ b/pkg/services/searchV2/testdata/prefix-search-beginning-lower.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 1 | Archer Data | | /pfix/d/1/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | Archer Data System | | /pfix/d/1/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "1" ], [ - "Archer Data" + "Archer Data System" ], [ "" diff --git a/pkg/services/searchV2/testdata/prefix-search-beginning.jsonc b/pkg/services/searchV2/testdata/prefix-search-beginning.jsonc index 022b5a15649..8831219a6bd 100644 --- a/pkg/services/searchV2/testdata/prefix-search-beginning.jsonc +++ b/pkg/services/searchV2/testdata/prefix-search-beginning.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 1 | Archer Data | | /pfix/d/1/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 1 | Archer Data System | | /pfix/d/1/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "1" ], [ - "Archer Data" + "Archer Data System" ], [ "" diff --git a/pkg/services/searchV2/testdata/prefix-search-middle-lower.jsonc b/pkg/services/searchV2/testdata/prefix-search-middle-lower.jsonc index 2db59e343f8..2fe14bb9129 100644 --- a/pkg/services/searchV2/testdata/prefix-search-middle-lower.jsonc +++ b/pkg/services/searchV2/testdata/prefix-search-middle-lower.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 2 | Document Sync | | /pfix/d/2/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 2 | Document Sync repo | | /pfix/d/2/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "2" ], [ - "Document Sync" + "Document Sync repo" ], [ "" diff --git a/pkg/services/searchV2/testdata/prefix-search-middle.jsonc b/pkg/services/searchV2/testdata/prefix-search-middle.jsonc index 2db59e343f8..2fe14bb9129 100644 --- a/pkg/services/searchV2/testdata/prefix-search-middle.jsonc +++ b/pkg/services/searchV2/testdata/prefix-search-middle.jsonc @@ -8,13 +8,13 @@ // } // Name: Query results // Dimensions: 8 Fields by 1 Rows -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | -// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | -// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ -// | dashboard | 2 | Document Sync | | /pfix/d/2/ | null | null | | -// +----------------+----------------+----------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | Name: kind | Name: uid | Name: name | Name: panel_type | Name: url | Name: tags | Name: ds_uid | Name: location | +// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | +// | Type: []string | Type: []string | Type: []string | Type: []string | Type: []string | Type: []*json.RawMessage | Type: []*json.RawMessage | Type: []string | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ +// | dashboard | 2 | Document Sync repo | | /pfix/d/2/ | null | null | | +// +----------------+----------------+--------------------+------------------+----------------+--------------------------+--------------------------+----------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -107,7 +107,7 @@ "2" ], [ - "Document Sync" + "Document Sync repo" ], [ ""