View on GitHub

Aggregations

Curiosity brings a complex aggregation system, which allows you to create fully customizable aggregation (nested, script ...)

Create an Aggregation

To create an aggregation, you just have to add an aggregation module to a card, a dropdown list will appears in the card in which you can chose aggregation's type. Then depending of the type, many input will be added automaticly in which you can specify aggregation's params.

The first fields is always aggregation's name (just for display, the real aggregation's name is random to avoid conflict if you add a lot of aggregations), and the second is the aggregation's template, which is used to customize the way results will be shown.

Then, when you have finished to create your aggregation, click on "Activate" button. It will add your aggregation to your query, After that click on the "List" icon to show results and launch your query. If your aggregation is corect, the results should appear.

Nested Aggregation

If your aggregation is a bucket aggregation (terms, range, histogram), you can add nested aggregation. Click on "Add Nested Aggregation" button, then fill input the same way you did before for the last aggregation.

Example

In this example we will see how to create an aggregation step by step. I'm working on an index that contains few lines of the works of shakespear. My goals is to create a simple terms aggregation on speaker.

Step 1 : Add an aggregation

  • First open modules pop-up
  • Then select "Aggregation" in the dropdown list
  • Click on "Add module"
  • Click on "Ok"

You just add an aggregation !

Step 2 : Configure the aggregation

  • Choose aggregation's type in the dropdown list (here "Terms")
  • Name your aggregation
  • Select your template (for the example we will use default template)
  • Select the field you want to work on
  • Click on validate
  • Switch display mode

Step 3 : Launch the query and have fun !