How to show empty bukets in aggregation Range

Hello
This visualization don't display the empty buckets ?!
How can i show the empty buckets
it's possible in agreagation histogram but I need to use range!
any solution?!

Thanks

{
  "aggs": [
    {
      "enabled": true,
      "id": "1",
      "params": {
        "customLabel": "NB doc
      },
      "schema": "metric",
      "type": "count"
    },
    {
      "enabled": true,
      "id": "2",
      "params": {
        "customLabel": "doc size",
        "field": "doc",
        "ranges": [
          {
            "from": 0,
            "to": 10
          },
          {
            "from": 11,
            "to": 21
          }  
        ]
      },
      "schema": "segment",
      "type": "range"
    },
    {
      "enabled": true,
      "id": "3",
      "params": {
        "customLabel": "Type",
        "exclude": "",
        "field": "type",
        "include": "doc",
        "json": "",
        "order": "desc",
        "orderBy": "1",
        "size": 6
      },
      "schema": "group",
      "type": "terms"
    }
  ],
  "listeners": {},
  "params": {
    "addLegend": true,
    "addTimeMarker": false,
    "addTooltip": true,
    "categoryAxes": [
      {
        "id": "CategoryAxis-1",
        "labels": {
          "filter": false,
          "show": true,
          "truncate": 100
        },
        "position": "bottom",
        "scale": {
          "type": "linear"
        },
        "show": true,
        "style": {},
        "title": {
          "text": "doc size"
        },
        "type": "category"
      }
    ],
    "defaultYExtents": false,
    "drawLinesBetweenPoints": true,
    "grid": {
      "categoryLines": false,
      "style": {
        "color": "#eee"
      },
      "valueAxis": "ValueAxis-1"
    },
    "interpolate": "linear",
    "legendPosition": "right",
    "orderBucketsBySum": false,
    "radiusRatio": 9,
    "scale": "linear",
    "seriesParams": [
      {
        "data": {
          "id": "1",
          "label": "NB Doc"
        },
        "drawLinesBetweenPoints": true,
        "mode": "stacked",
        "show": "true",
        "showCircles": true,
        "type": "histogram",
        "valueAxis": "ValueAxis-1"
      }
    ],
    "setYExtents": false,
    "showCircles": true,
    "times": [],
    "valueAxes": [
      {
        "id": "ValueAxis-1",
        "labels": {
          "filter": false,
          "rotate": 0,
          "show": true,
          "truncate": 100
        },
        "name": "LeftAxis-1",
        "position": "left",
        "scale": {
          "mode": "normal",
          "type": "linear"
        },
        "show": true,
        "style": {},
        "title": {
          "text": "NB Doc"
        },
        "type": "value"
      }
    ]
  },
  "title": "display ",
  "type": "histogram"
}

Hi there, could you please describe in more detail what you want to do, what it is you've tried so far, and what the result you got was?

Thanks,
CJ

Hello @cjcenizal,
In my vertical bar visualization, I used aggregation range but the results don't return the empty buckets !!
and I need to display it
Thanks,
radi

hi @cjcenizal , Any idea after my describe?

I tested with aggregation histogram the results return the empty buckets !!
But the display is not clear for the user to consult that it exists so many contents with the size of 0, which is not the point but as the vertical bar starts with 0 it is a false information (its value entre 0 and lower of 1MB) than a that is why I used aggregation range with interval ( 0B to 1MB) but I need to display the empty buckets if i keep use the vertical bar with aggregation range or correcte the start value of vertical bar used aggregation with histogram!

My needs come from two different solutions :confused:

2018-04-24%2016_57_40-D%C3%A9marrer
Regards,
radi
@Marius_Dragomir

Hey radi,

This is indeed an edge case. You might have to create the ranges by hand and just set the first one lower than the precision of the bytes field, so it could be something like 0- 0.5 or something similar and the rest of the buckets can use your normal interval.
But, how I would use it is just create 2 vis like this, one next to each other on a dashboard and the one that will display the empty values should have a filter on value:0. That way it will always be accurate.

Hi @Marius_Dragomir, thanks for your return
when i use the ranges the empty buckets is missing and i need this information :frowning:

2018-04-24%2017_51_14-D%C3%A9marrer

I think I don't understand when you said changing the interval yes in aggregation with range i can do it

2018-04-24%2017_55_37-D%C3%A9marrer
But what i missing is to display empty buckets OR use the agragation with histogram but find solution to not start with value 0B I don't see how changing that is auomatic the beginning by 0
When i say there is contentes with size 0 its false i have no contents with size 0 but the vertical bar with histogram start by 0 !

What version of Kibana are you using? I can see the empty buckets in the Range aggregation in Kibana 6.2.4:

The "Show empty buckets" only makes sense on the Histogram aggregation because there ES generates the ranges and by default it only returns the ones with data in them.

@Marius_Dragomir unfortunately i used version 5.4 .... it's ok for me to use the historgram agregation but it's starting with 0 it's possible to change that ? it's like i have contents with 0B and it's not true it's just the display betwen 0 and 1mb but the display not really clear

Regards
radi

You just want to filter out the ones that have the value as 0? If that's the problem, I can help.
Just add this to the query bar near the top: !memory:0 and it will filter out the ones that are 0.

Please, have a look at the screenshot attached: The X-Axis says that we have 161 photos of Size 0. Which is wrong. 161 is the number of photos which size is between 0 to 1MB! So this kind of display will be misunderstood by the end-user.

That's why we were looking around the range display that don't have this confusing display.

You cannot change the way the labels are displayed there, sorry. This is why the range aggregation would work better. But since that seems buggy on 5.4 I don't really think you can do anything else other than upgrading. I can look to see if any PR is related to this issue and point you to the easiest version to update to where that range works properly.

Looks like 5.6.3 works properly with empty ranges. You can try with that version.

Thanks for your help, I proposed the upgrade to another version how works properly with empty ranges, but it's not possible to do this procedure right now.
That's why if you can tell me in which part of the project there was the change to add empty buckets to try to modify version 5.4.0 local ( which was added in version 5.6.3 to make empty buckets work ???)

Best regards
Radi

I've looked for issues, couldn't find anything related to that, so it must have been some kind of side-effect of fixing another issue. You can look in this area for any code changes that might help you: https://github.com/elastic/kibana/blob/5.4/src/ui/public/agg_types/buckets/range.js

@Marius_Dragomir, thanks for your help, I will follow your advice and make a code comparison of my current version 5.4 of Kibana with the version that offers empty buckets range the one you mentioned 5.6.3
Best regards
Radi

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