Monday, August 24, 2015

ElasticSearch Business Intelligence & Reporting

Announcing ElasticSearch Integration

Due to popular customer demand, Cloud9 Charts is happy to announce native Business Intelligence support for ElasticSearch, a leading open source full text search engine with a JSON based schema-free persistence store.  

This integration combines ElasticSearch query and search capabilities to easily produce shareable visual insights quickly. In addition, for the very first time, our join capabilities provide unified insights into ElasticSearch as well other NoSQL and SQL based datasources, eliminating cumbersome engineering and heavy ETL processes into relational databases.  

To get started, visit our ElasticSearch page, which is preconfigured with a demo ElasticSearch cluster settings to get started.

In the following example, we’ll walk through the following:
  • Connect to a demo ElasticSearch cluster
  • Execute queries against it
  • Join the results with some data in MySQL
  • Visualize, track and share the results

 Connect:
The following animated gif shows how to connect to our ElasticSearch cluster. 

(Note: If the cluster is behind your firewall, please use our agent)





Let's also set up connectivity to our demo MySQL datasource using the default settings -  that we’ll use for Joins later.

Query:
Once the datasource is setup, click on the Configure Queries link:
  1. Specify ElasticSearch JSON query. In our example, let's search for matches for all documents that contains Transactional.
  2.   {
         "size":1000,
         "query": {
             "query_string": {
                 "query": "Transactional*"
            }
         }
      }
    
  3. Click on Preview to return all documents for that query. This returns the first 1000 matches. 

  4. Let's add some Cloud9QL to post process the data further. Note that the Cloud9QL is optional, and is not a replacement to ElasticSearch query - it provides a powerful way to complement ElasticSearch query to transform the results. In the following example, let's transform the results further to get the sum of the sent field, grouped by customer. 
  5. select sum(sent) as Sent, customer 
    group by customer
    Click on Preview to immediately see the updated results.

  6. Joins: Now that we have some basic data from ElasticSearch, say that we need to join this data with customer details that exists in a MySQL database. 
    • Click on Join --> Select the new MySQL datasource --> Under Query Generator, select the customer table
    • Add customer=customer in the Join Fields box. This implies that customer fields from the ElasticSearch query will be used to lookup (inner join) against customer field in the MySQL query.
            More on Joins: https://www.cloud9charts.com/docs/multi-datasource-joins.html
  
            Click on Preview.


The results now include customer details from MySQL combined together with the data from ElasticSearch.

5. Click on 'Save' to save it, then add it to a dashboard to easily share and embed it.