Kibana unique count more that number of records

hi everyone

I´m using kibana dashboards, and when I try to add a metric with unique count to select all uniques the number of uniques is not the same that the number of records that I have, for example in my index I've 52727 records but when I do the metric with unique count the result that I´ve is 52903, and I don´t know why, Isn´t problem of data the field that I´m using exist in each record, it doesn´t have spaces or any character that can be part of the problem, in fact is an UUID

hope you can help me

Hi @erickhillo Welcome to the community

Can you show the exact commands and the results you ran that resulted in these results? Otherwise we can't help :slight_smile:

GET example/_search
{
  "size": 0, 
  "_source": false, 
  "query": {
    "match": {
      "comprobante_type":"comprobantes"
    }
  },
  "aggs": {
    "Total_unique": {
      "cardinality": {
        "field": "myfieldhere"
        }
      }
  }
}

this is my query and I got this result

},
  "aggregations": {
    "total_unique": {
      "value": 72903
    }
  }
}

but in my discover I've these result with same filters

What version of Elasticsearch and Kibana is that?

Also one has a time frame and other does not?

What is the query in discover?

Also you should probably use a term query if the type is keyword

You can also look at inspect to see the query from Kibana...