How can I write these following query in kibana?
SELECT distinct description FROM customers;
select description,count(*) from customers;
I am trying with following but not getting expected result.
1st Query
GET customers/_search
{
"aggs": {
"distinct_terminals": {
"cardinality": {
"field":"description" // and tried with "description.keyword"
}
}
}
}
2nd Query
GET customers/_search{
"size": 0,
"aggs": {
"country_detail": {
"terms": {
"field": "Country.keyword"
}
}
}
}
2nd query return result as expected but when I was trying to perform this query on a field like a description. it stops working. i.e.
GET customers/_search{
"size": 0,
"aggs": {
"description_detail": {
"terms": {
"field": "Description.keyword"
}
}
}
}
Description cannot be 2 3 words. it should be more than that, maybe in a paragraph.