Problem with custom filter sub aggregations in area visualization

I try to represent trough time documents containing reference to some countries and not containing them.

I set 2 filters

GET /article/_search
{
  "size": 0,
  "aggs" : {
    "country" : {
      "filter":{
          "bool":{
              "must": {
                    "terms":{
                    "Fulltext" : ["sierra leone", "liberia"]
                    }
                  }
          }
      }
    },
    "not_country" : {
      "filter":{
          "bool":{
              "must_not": {
                    "terms":{
                    "Fulltext" : ["sierra leone", "liberia"]
                    }
                  }
          }
      }
    }
  }
} 

And it seems fine. I get this return

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 5285,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  },
  "aggregations" : {
    "country" : {
      "doc_count" : 713
    },
    "not_country" : {
      "doc_count" : 4572
    }
  }
} 

But the problem comes when I use those filters in the area vizualisation settings (Buckets > Split Series > Sub Aggregation > Filters). The vizualisation shows 0 "not_country" documents whereas there should be 713. And even the "country" documents count is wrong (I got 2432 when I gather them all in a custom time period whereas I should get 4572).

Can you help me ?

Hey @letailli, welcome to the discussion boards!

It's not clear to me how you're setting the country and not_country filters in your screenshot above. I would have expected to see something like my screenshot below, with the two filters specified inline:

It works perfectly that way !
Thank you very much

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