0
votes

I'm new with Elastic and kibana. I'm creating my first visualizations in Kibana. I started with what I thought would be something easy: bar chart. However, I am quite lost with the documentation. I have an index with the following mapping:

{
  "mapping": {
    "properties": {
      "fake": {   ###### classification field
        "type": "long"
      },
      "paper": {   ###### newspaper name
        "type": "text"
      },
      "published": {   ###### published date of the new
        "type": "date"
      },
      "title": {
        "type": "text"
      },
      "url": {
        "type": "text"
      }
    }
  }
}

I'm just trying to implement a test chart with the following aggregation: Y-Axis: average of field "fake" X-Axis: newspaper name field (paper).

It should look something like this: https://www.screencast.com/t/90IpoSnz

This is my configuration for Y-Axis: https://www.screencast.com/t/466TFuE3osrw

However, when configuring the X-axis I can't see the field "paper" among the available fields. I'm sure it's a problem with my mapping but I don't know how I should define that field in order to have it selectable.

Many thanks!

2

2 Answers

1
votes

Metrics

Select metric aggregation for Y-axis as Average select field fake

Buckets

select X-Axis as buckets, select Aggregation inside as Terms and field paper.

Run the visualization and you should see the expected bar chart.

0
votes

Even though my field was showing on the index pattern settings I realised it wasn't marked as aggregatable hence I had to redefine my index mappings by adding an analyzer to my field: From

paper = Text()

I changed to:

paper = Text(analyzer='standard', fields={'raw': Keyword()})

Many thanks