1

I am looking for a solution to the problem

Problem: i have two records A:Trace(id, traceId, Tags) B:Trace(id,traceId, Tags) both records have same traceId and different tags

for that i used should Clause which return data even if only record A have tag in it. But what i want is that if query have tags that are not in records there should be empty response.

this is the query i actually used on Zipkin ELasticsearch Data

GET zipkin-span-2021-12-08/_search?size=10
{
  "query": {
    "bool": {
      "must": [
        {
          "bool": {
            "should": [
              {
                "term": {
                  "_q": "smpp.charged=false"
                }
              },
              {
                "term": {
                  "_q": "connection.type=WEEK"
                }
              },
              {
                "term": {
                  "_q": "connection.type=a"
                }
              }
            ]
          }
        }
      ]
    }
  },
  "aggs": {
    "same_treace_id": {
      "terms": {
        "field": "traceId",
        "size": 10,
        "min_doc_count": 2
      }
    }
  },
  "fields": [
    "traceId"
  ],
  "_source": true
}

0 Answers0