Get Started with Fusion Dashboards

In this tutorial we build an analytics dashboard over signal data.

The Fusion distribution includes a directory named "fusion/3.1.x/examples/signals", where "fusion/3.1.x" is the top-level directory of the Fusion distribution, which contains:

  • The data file signals.json, a synthetic dataset of 20,000 click-signal events, based on a set of Best Buy query logs from 2011. This file contains a list of JSON objects, where each object contains information about a search query, a set of search categories, and the item ultimately clicked on.

  • The script file signals.sh, which loads the raw signal data and then runs aggregations.

First we load the raw signal data into a Fusion collection. Then we create a new time-series dashboard and populate it with input and display panels.

Dashboard Controls

Here’s how to interact with the Dashboard interface.

You can launch the Dashboards tool from the Fusion UI, via the Fusion Applications menu:

Dashboards application in the UI

When launched from the Fusion UI, the Dashboards tool appears in a new tab titled Banana 3. The title changes to the name of the dashboard. The initial dashboard is the built-in Fusion Logs dashboard:

Logfiles dashboard

The left side of the top menu bar displays the Dashboard title. The right side of the top menu contains a set of controls:

Banana3 menu bar

  • The home icon is the "Go to Default Dashboard" control. The initial default dashboard is the "Fusion Logs" dashboard.

  • The sheet of paper icon opens the "Create Dashboard" dialog.

  • The folder icon opens the "Load Dashboard" dialog.

  • The diskette icon opens the "Save Dashboard" dialog.

  • The gear icon opens the "Configure Dashboard" dialog for the current dashboard, which has tabs:

    • "General" : title and page style

    • "Rows" : for adding, deleting and arranging the rows

    • "Controls" : loading, save, and export options

    • "Solr" : configure Solr server and set global query parameters.

Create the Raw Signals Collection

In this example, we create a Log Analytics Dashboard using a synthetic log dataset. This file contains a list of JSON objects, where each object contains information about a search query, a set of search categories, and the item ultimately clicked on.

The first JSON object in this dataset is:

    "timestamp": "2011-09-01T23:44:52.533Z",
    "params": {
      "query": "Televisiones Panasonic  50 pulgadas",
      "docId": "2125233",
      "filterQueries": [
        "cat00000",
        "abcat0100000",
        "abcat0101000",
        "abcat0101001"
      ]
    },
    "type": "click"

The top-level attributes of this object are:

  • type - A required field for all signals. In the example dataset, all signals are of type click.

  • timestamp - The time at which this click was logged.

  • params - This attribute contains a set of key-value pairs for search-query event information.

In this dataset, the information captured includes the free-text search query entered by the user, the document id of the item clicked on, and the set of Best Buy site categories that the search was restricted to. These are codes for categories and sub-categories such as "Electronics" or "Televisions".

The example script signals.sh loads the raw signal via a POST request to the Fusion REST API endpoint: /api/apollo/signals/<collectionName> where <collectionName> is the name of the primary collection itself.

I create the primary collection "myAnalytics" from the Fusion UI. By default, this collection has feature "signals" enabled, therefore I can load the raw signal data into Fusion collection "myAnalytics_signals" by sending a POST request to the endpoint: /api/apollo/signals/myAnalytics

To run this command on a local Fusion installation using all default ports, the request is:

curl -u <user>:<password> -X POST\
 -H 'Content-type:application/json'\
 http://localhost:8764/api/apollo/signals/myAnalytics?commit=true\
 --data-binary @<some-path>/signals.json

This command succeeds silently.

To verify that the collection "myAnalytics_signals" exists, view the collection details in the Fusion UI via URL: "localhost:8764/panels/myAnalytics_signals".

Collection myAnalytics

Create the Dashboard

Time-series dashboards show trends over time by using the timestamp field to aggregate query results. To create a time-series dashboard over the collection "myAnalytics_signals", from the Dashboards application, use the "New" control to open the "Create Dashboard" dialog and choose the option "new time-series dashboard"

Dialog time series dashboard

The next step is configuring the dashboard settings:

Dialog time series dashboard

The newly created dashboard is called "New Time Series Dashboard". It contains 4 rows: * Row 1 contains the input controls and a display panel showing total hits. * Row 2 displays the time range specified in the search query * Row 3 contains a visual display of hits per date-time interval * Row 4 contains a table over all documents in the result set.

In the example above, the dashboard is populated with results for the following Solr query parameters:

q=*:*&
fq=timestamp_tdt:[NOW/MINUTE-15MINUTE TO NOW/MINUTE+1MINUTE]&
wt=json&rows=0

The example signals data was collected during the months of August through October 2011. After the "Time Range" panel is configured with this date range, the new Solr query parameters are:

q=*:*&
fq=timestamp_tdt:[2011-08-01T04:00:00.000Z TO 2011-11-01T03:59:59.000Z]&
wt=json&rows=0

This query returns all 20,000 raw signals and the panel is updated accordingly.

Configure the Histogram Panel

Solr facets provide the counts displayed by the Histogram. The facet parameters are derived from the TimePicker selection and the controls on the Histogram display panel. These controls are used to select the type of count display and the time interval over which counts are aggregated.

After this interval is set to 1-day, the dashboard shows the daily activity for the timespan:

Time series dashboard historical timespan

Clicking on the "info" icon on the Histogram controls shows the Solr query parameters:

q=*:*&
wt=json&rows=0&
fq=timestamp_tdt:[2011-08-01T04:00:00.000Z TO 2011-11-01T03:59:59.000Z]&
facet=true&
facet.range=timestamp_tdt&
facet.range.start=2011-08-01T04:00:00.000Z&
facet.range.end=2011-11-01T03:59:59.000Z&
facet.range.gap=+1DAY

Configure the Table Panel

The table panel displays the documents in the results set, 1 per row. The default display shows all document fields. The table "Fields" control is used to select the fields. The table header row column headers have arrows which allow shifting the column position left or right.

After selecting a subset of the document fields and ordering the display accordingly, the table panel shows the essential raw signal document fields:

Time series dashboard table

Save the Dashboard

The work done to create and configure this new time series dashboard is all work that has been done client-side. In order to save this dashboard for future sessions, it must be saved back to Fusion.

Before saving the dashboard, we rename it to "myAnalytics_signals dashboard" using the "Dashboard Settings" controls, which are accessed by clicking the gear icon on the top menu bar.

The top menu bar diskette icon opens the Save dialog. The option "Solr" saves the configured dashboard to Fusion.

Saving a dashboard

The top menu bar folder icon opens the Load dialog. From this controls you can either reload or delete a saved dashboard configuration.

When the dashboard configuration is reloaded, the configured Solr query or queries will be rerun and the panel displays will be populated with the results.

Conclusion

In this section we have demonstrated how to create, configure, and save a new dashboard. The essential principles are:

  • Dashboards are client-side application.

  • Input panels create and submit queries to Fusion

  • Dashboard displays are highly configurable.

  • Configurations can be saved on the server.

For more on this topic, see the Lucidworks blog: