Web pivot tables by ElasticSearch Data Source Setup

Cube schema is specified in the appsettings.json file.

Cube config for ElasticSearch should have "SourceType": "elasticsearch" and additional "SourceElasticSearch" section:

  "Id": "elastic-bank-accounts",
  "Name": "Bank Accounts from sample ElasticSearch dataset",
  "SourceType": "elasticsearch",
  "SourceElasticSearch": {
    "ConnectionUrl": "https://ReadOnly:nxxr8qt7n26c7jwijhwg1ipnarf402yn@thorin-us-east-1.searchly.com",
    "Index": "bank"
  "InferSchema": true,  /* dimensions and measures are determined automatically by first N documents */
  "Dimensions": [],
  "Measures": [],
  "Parameters": []

"ConnectionURL" specifies base URL of your ElasticSearch API. "Index" specifies index name to query.

NOTE: "InferSchema" is useful for temp data sources, testing or development purposes; for production use it is better to specify list of dimensions and measures explicitely to avoid some overhead (startup delay) caused by probe query.


In case of ElasticSearch data source dimension name refers to the document or sub-document field name:

  "Dimensions": [
      "Name": "name.keyword",  /* don't forget to specify '.keyword' suffix for text fields */
      "LabelText": "Name"
      "Name": "address.street.keyword",  /* use dot to specify sub-document field */
      "LabelText": "Street"

It is possible to specify script field by providing "Params" array:

      "Name" : "registered_year",
      "Params": ["doc[\"registered\"].empty ? null : doc[\"registered\"].date.year", "number"]

First parameter is an inline script expression ("painless" syntax), and second one determines result type ("number" or "string").


Measure parameter (if used) should refer to the document field:

  "Measures": [
       "Type": "Average",
       "Params": [ "age" ],
       "LabelText": "Average Age"


Currently report parameters are not supported by ElasticSearch connector.