Aggregation on result set

Hi,

i have 2 queries
Can i do an aggregation on a queried data?
on an aggregation result can i perform any query?

No you cannot.

i ran the following aggregation

"aggs": {
"userdetails": {
"terms": {
"field": "userName"
},
"aggs": {
"infodetails": {
"cardinality": {
"field": "info"
}
}
}
}
}

with the above aggregation got the following results
"aggregations": {
"userdetails": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "test1",
"doc_count": 2,
"infodetails": {
"value": 2
}
},
{
"key": "test2",
"doc_count": 1,
"infodetails": {
"value":1
}
}
]
}
}

if i want to restrict buckets based on cardinality value. what is the way?
for example in the above scenario i got 2 results one with value 1 and other with 2.
suppose i want to have buckets with cardinality more than 2?
this is the requirement i have, please let me know what can i use to achieve this

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.