Search: Add substring matcher (#54813)

* search: bring back substring search

* lint fix

* search: bring back ngram

* search: bring back ngram

* search: more tests
This commit is contained in:
Artur Wierzbicki
2022-09-08 12:10:30 +02:00
committed by GitHub
parent b4e3c89f60
commit 1353177e15
11 changed files with 424 additions and 152 deletions
@@ -2,23 +2,15 @@
//
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 10 Rows
// +---------------------------+--------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +---------------------------+--------------------+
// | dynamic (2) | 61.26983678470653 |
// | roci-simple-2 | 52.417145624935095 |
// | Prometheus 2.0 | 45.193422538475374 |
// | Prometheus 20.0 | 45.193422538475374 |
// | Prometheus Stats | 45.193422538475374 |
// | prometheus histogram | 45.193422538475374 |
// | prometheus histogram2 | 45.193422538475374 |
// | Panel Tests - Bar Gauge 2 | 40.74215154954845 |
// | Prometheus 2.0 Stats | 38.70210379766075 |
// | Prometheus Second Word | 38.70210379766075 |
// +---------------------------+--------------------+
// Dimensions: 2 Fields by 2 Rows
// +----------------------+-------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +----------------------+-------------------+
// | Prometheus 2.0 | 7.621131552585596 |
// | Prometheus 2.0 Stats | 7.621131552585596 |
// +----------------------+-------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -47,28 +39,12 @@
"data": {
"values": [
[
"dynamic (2)",
"roci-simple-2",
"Prometheus 2.0",
"Prometheus 20.0",
"Prometheus Stats",
"prometheus histogram",
"prometheus histogram2",
"Panel Tests - Bar Gauge 2",
"Prometheus 2.0 Stats",
"Prometheus Second Word"
"Prometheus 2.0 Stats"
],
[
61.26983678470653,
52.417145624935095,
45.193422538475374,
45.193422538475374,
45.193422538475374,
45.193422538475374,
45.193422538475374,
40.74215154954845,
38.70210379766075,
38.70210379766075
7.621131552585596,
7.621131552585596
]
]
}
+14 -14
View File
@@ -3,16 +3,16 @@
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 4 Rows
// +----------------------+--------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +----------------------+--------------------+
// | Prometheus 2.0 | 2.861163199700355 |
// | Prometheus 20.0 | 2.795309067950216 |
// | Prometheus Stats | 2.6766576425310045 |
// | Prometheus 2.0 Stats | 2.5727172425512226 |
// +----------------------+--------------------+
// +----------------------+-------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +----------------------+-------------------+
// | Prometheus 2.0 | 9.502378631081775 |
// | Prometheus 20.0 | 9.458475876581684 |
// | Prometheus Stats | 9.379374926302209 |
// | Prometheus 2.0 Stats | 9.310081326315688 |
// +----------------------+-------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -47,10 +47,10 @@
"Prometheus 2.0 Stats"
],
[
2.861163199700355,
2.795309067950216,
2.6766576425310045,
2.5727172425512226
9.502378631081775,
9.458475876581684,
9.379374926302209,
9.310081326315688
]
]
}
@@ -2,20 +2,14 @@
//
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 7 Rows
// +------------------------+--------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +------------------------+--------------------+
// | Prometheus 2.0 | 45.193422538475374 |
// | Prometheus 20.0 | 45.193422538475374 |
// | Prometheus Stats | 45.193422538475374 |
// | prometheus histogram | 45.193422538475374 |
// | prometheus histogram2 | 45.193422538475374 |
// | Prometheus 2.0 Stats | 38.70210379766075 |
// | Prometheus Second Word | 38.70210379766075 |
// +------------------------+--------------------+
// Dimensions: 2 Fields by 1 Rows
// +------------------+-------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +------------------+-------------------+
// | Prometheus Stats | 7.621131552585596 |
// +------------------+-------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -44,22 +38,10 @@
"data": {
"values": [
[
"Prometheus 2.0",
"Prometheus 20.0",
"Prometheus Stats",
"prometheus histogram",
"prometheus histogram2",
"Prometheus 2.0 Stats",
"Prometheus Second Word"
"Prometheus Stats"
],
[
45.193422538475374,
45.193422538475374,
45.193422538475374,
45.193422538475374,
45.193422538475374,
38.70210379766075,
38.70210379766075
7.621131552585596
]
]
}
@@ -0,0 +1,62 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 5 Rows
// +--------------------------+--------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +--------------------------+--------------------+
// | Loki 2.0 | 9.273036652923247 |
// | Loki 2.0 Stats | 8.951742733604135 |
// | Loki 20.0 | 2.57580523764178 |
// | Loki histogram2 | 2.2807887502617943 |
// | Loki Tests - Bar Gauge 2 | 2.045832444623899 |
// +--------------------------+--------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"frames": [
{
"schema": {
"name": "ordering frame",
"fields": [
{
"name": "name",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "score",
"type": "number",
"typeInfo": {
"frame": "float64"
}
}
]
},
"data": {
"values": [
[
"Loki 2.0",
"Loki 2.0 Stats",
"Loki 20.0",
"Loki histogram2",
"Loki Tests - Bar Gauge 2"
],
[
9.273036652923247,
8.951742733604135,
2.57580523764178,
2.2807887502617943,
2.045832444623899
]
]
}
}
]
}
@@ -0,0 +1,71 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 8 Rows
// +--------------------------+-------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +--------------------------+-------------------+
// | Loki 2.0 | 8.386497572003142 |
// | Loki 20.0 | 8.351238737232393 |
// | Loki Stats | 8.289644692681875 |
// | Loki 2.0 Stats | 8.237634633059454 |
// | Loki histogram | 8.237634633059454 |
// | Loki histogram2 | 8.214550743132483 |
// | Loki Second Word | 8.173207674966303 |
// | Loki Tests - Bar Gauge 2 | 8.105690026892566 |
// +--------------------------+-------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"frames": [
{
"schema": {
"name": "ordering frame",
"fields": [
{
"name": "name",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "score",
"type": "number",
"typeInfo": {
"frame": "float64"
}
}
]
},
"data": {
"values": [
[
"Loki 2.0",
"Loki 20.0",
"Loki Stats",
"Loki 2.0 Stats",
"Loki histogram",
"Loki histogram2",
"Loki Second Word",
"Loki Tests - Bar Gauge 2"
],
[
8.386497572003142,
8.351238737232393,
8.289644692681875,
8.237634633059454,
8.237634633059454,
8.214550743132483,
8.173207674966303,
8.105690026892566
]
]
}
}
]
}
@@ -0,0 +1,53 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0]
// Name: ordering frame
// Dimensions: 2 Fields by 2 Rows
// +----------------+-------------------+
// | Name: name | Name: score |
// | Labels: | Labels: |
// | Type: []string | Type: []float64 |
// +----------------+-------------------+
// | Loki Stats | 9.397899591158676 |
// | Loki 2.0 Stats | 2.638536183312778 |
// +----------------+-------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"frames": [
{
"schema": {
"name": "ordering frame",
"fields": [
{
"name": "name",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "score",
"type": "number",
"typeInfo": {
"frame": "float64"
}
}
]
},
"data": {
"values": [
[
"Loki Stats",
"Loki 2.0 Stats"
],
[
9.397899591158676,
2.638536183312778
]
]
}
}
]
}
@@ -3,19 +3,17 @@
// Frame[0] {
// "type": "search-results",
// "custom": {
// "count": 2
// "count": 0
// }
// }
// 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 | 2 | A secret is powerful when it is empty (Umberto Eco) | | /pfix/d/2/ | null | [] | |
// | dashboard | 1 | Three can keep a secret, if two of them are dead (Benjamin Franklin) | | /pfix/d/1/ | null | [] | |
// +----------------+----------------+----------------------------------------------------------------------+------------------+----------------+--------------------------+-------------------------+----------------+
// Dimensions: 8 Fields by 0 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 |
// +----------------+----------------+----------------+------------------+----------------+--------------------------+-------------------------+----------------+
// +----------------+----------------+----------------+------------------+----------------+--------------------------+-------------------------+----------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -27,7 +25,7 @@
"meta": {
"type": "search-results",
"custom": {
"count": 2
"count": 0
}
},
"fields": [
@@ -100,38 +98,14 @@
},
"data": {
"values": [
[
"dashboard",
"dashboard"
],
[
"2",
"1"
],
[
"A secret is powerful when it is empty (Umberto Eco)",
"Three can keep a secret, if two of them are dead (Benjamin Franklin)"
],
[
"",
""
],
[
"/pfix/d/2/",
"/pfix/d/1/"
],
[
null,
null
],
[
[],
[]
],
[
"",
""
]
[],
[],
[],
[],
[],
[],
[],
[]
]
}
}
+6 -15
View File
@@ -3,18 +3,17 @@
// Frame[0] {
// "type": "search-results",
// "custom": {
// "count": 2
// "count": 1
// }
// }
// Name: Query results
// Dimensions: 8 Fields by 2 Rows
// 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 | Three can keep a secret, if two of them are dead (Benjamin Franklin) | | /pfix/d/1/ | null | [] | |
// | dashboard | 2 | A secret is powerful when it is empty (Umberto Eco) | | /pfix/d/2/ | null | [] | |
// +----------------+----------------+----------------------------------------------------------------------+------------------+----------------+--------------------------+-------------------------+----------------+
//
//
@@ -27,7 +26,7 @@
"meta": {
"type": "search-results",
"custom": {
"count": 2
"count": 1
}
},
"fields": [
@@ -101,35 +100,27 @@
"data": {
"values": [
[
"dashboard",
"dashboard"
],
[
"1",
"2"
"1"
],
[
"Three can keep a secret, if two of them are dead (Benjamin Franklin)",
"A secret is powerful when it is empty (Umberto Eco)"
"Three can keep a secret, if two of them are dead (Benjamin Franklin)"
],
[
"",
""
],
[
"/pfix/d/1/",
"/pfix/d/2/"
"/pfix/d/1/"
],
[
null,
null
],
[
[],
[]
],
[
"",
""
]
]