title: Bucket selector in sub aggregation or cardinality aggregation
body: <p>I have this query</p>
  
  <pre><code>GET /my_index3/_search 
  {
  "size": 0,
    "aggs": {
      "num1": {
        "terms": {
          "field": "num1.keyword",
          "order" : { "_count" : "desc" }
        },
        "aggs": {
          "count_of_distinct_suffix": {
            "cardinality" :{
               "field" : "suffix.keyword"
            },
            "aggs": {
              "filter_count": {
                "bucket_selector": {
                  "buckets_path": {
                     "the_doc_count": "_count"
                  },
                  "script": "params.doc_count == 2"
                }
              }
            }
          }
        }
      }
    } 
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>          "key" : "1563866656878888",
            "doc_count" : 42,
            "count_of_distinct_suffix" : {
              "value" : 2
            }
          },
          {
            "key" : "1563866656871111",
            "doc_count" : 40,
            "count_of_distinct_suffix" : {
              "value" : 2
            }
          },
          {
            "key" : "1563867854325555",
            "doc_count" : 36,
            "count_of_distinct_suffix" : {
              "value" : 1
            }
          },
          {
            "key" : "1563867854323333",
            "doc_count" : 12,
            "count_of_distinct_suffix" : {
              "value" : 1
            }
          },
  </code></pre>
  
  <p>I want to see only the results which have "count_of_distinct_suffix" : { "value" : 2 }</p>
  
  <p>I'm thinking about bucket selector aggregation but it's impossible to add it into the cardinality aggs...</p>
  
  <pre><code>         "aggs": {
          "my_filter": {
             "bucket_selector": {
                "buckets_path": {
                   "the_doc_count": "_count"
                },
                "script": "params.doc_count == 2"
             }
          }
       }
  </code></pre>
  
  <p>It gives me the following <code>error: Aggregator [count_of_distinct_suffix] of type [cardinality] cannot accept sub-aggregations</code></p>
  
  <p>Do you guys have any idea to solve it?</p>
  
  <p>Thank you very much for any help in advance !!</p>