diff --git a/plugin/storage/es/spanstore/fixtures/query_01.json b/plugin/storage/es/spanstore/fixtures/query_01.json index e38c1e84ac4..a433bb44062 100644 --- a/plugin/storage/es/spanstore/fixtures/query_01.json +++ b/plugin/storage/es/spanstore/fixtures/query_01.json @@ -4,9 +4,9 @@ { "bool":{ "must":{ - "match":{ + "regexp":{ "tag.bat@foo":{ - "query":"spook" + "value":"spook" } } } @@ -15,9 +15,9 @@ { "bool":{ "must":{ - "match":{ + "regexp":{ "process.tag.bat@foo":{ - "query":"spook" + "value":"spook" } } } @@ -37,9 +37,9 @@ } }, { - "match":{ + "regexp":{ "tags.value":{ - "query":"spook" + "value":"spook" } } } @@ -62,9 +62,9 @@ } }, { - "match":{ + "regexp":{ "process.tags.value":{ - "query":"spook" + "value":"spook" } } } @@ -87,9 +87,9 @@ } }, { - "match":{ + "regexp":{ "logs.fields.value":{ - "query":"spook" + "value":"spook" } } } diff --git a/plugin/storage/es/spanstore/reader.go b/plugin/storage/es/spanstore/reader.go index 29124eda749..046ad192068 100644 --- a/plugin/storage/es/spanstore/reader.go +++ b/plugin/storage/es/spanstore/reader.go @@ -622,14 +622,14 @@ func (s *SpanReader) buildNestedQuery(field string, k string, v string) elastic. keyField := fmt.Sprintf("%s.%s", field, tagKeyField) valueField := fmt.Sprintf("%s.%s", field, tagValueField) keyQuery := elastic.NewMatchQuery(keyField, k) - valueQuery := elastic.NewMatchQuery(valueField, v) + valueQuery := elastic.NewRegexpQuery(valueField, v) tagBoolQuery := elastic.NewBoolQuery().Must(keyQuery, valueQuery) return elastic.NewNestedQuery(field, tagBoolQuery) } func (s *SpanReader) buildObjectQuery(field string, k string, v string) elastic.Query { keyField := fmt.Sprintf("%s.%s", field, k) - keyQuery := elastic.NewMatchQuery(keyField, v) + keyQuery := elastic.NewRegexpQuery(keyField, v) return elastic.NewBoolQuery().Must(keyQuery) }