Quantcast

How to Achieving count(distinct(doc['userId'])) with facets script

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to Achieving count(distinct(doc['userId'])) with facets script

saud.rehman
This post has NOT been accepted by the mailing list yet.
{
    "query" : {
        "match_all" : {  }
    },
    "facets" : {
        "stats" : {
            "terms_stats" : {
                "key_field" : "tag",
                "value_script" : "count(distinct(doc['num1'].value))"
            }
        }
    }
}
Loading...