Sample App – IBM Insights for Twitter Service on Bluemix

Share this post:

As I was working on SOmusic, I experimented with the Insights for Twitter test application provided to define the queries I would be using and to understand the result format:


It got the job done, but as I was going back and forth in the documentation of the query language, I thought we could have a more complete search user interface. Step 1 of my solution is shown below:

The interface uses the impressive jQuery QueryBuilder plugin to visually assemble the query. The experts can directly use the “Raw Query” field type but the uninitiated can pick fields from the list. Each field has a description you can display by pressing the blue “i” button. The plugin supports creating nested queries so that you can build more complex searches combining AND/OR groups.

Once the query is defined, use the Twitter Search button to get a subset of the results:

Of course you can deploy the app in your own Bluemix account and tweak the code if you want to get more results here. Step 3 shows the tweets:

Select a tweet to view its details in Step 4; this uses the Twitter oEmbed API:

In both steps 3 and 4, you can switch to the Source tab to view the raw JSON data. Step 5 in the UI shows the Insights for Twitter enrichments. You can query these fields in the search, making this a great way to tailor the results to your needs:

In Step 6, you can copy a link that embeds the query definition, so that you can pass it to a friend or bookmark it:

For sake of completeness, below is a full screenshot showing the 1-6 steps above (click to enlarge):

The source code is posted at IBM-Bluemix/insights-search on GitHub. A sample version is deployed at but you can use the Deploy button below to deploy it to your own Bluemix account:

Deploy Insights Search application to your Bluemix account

If you have comments on the user interface or would like to suggest improvements, please reply below!

More stories
February 13, 2019

Simplify and Automate Deployments Using GitOps with IBM Multicloud Manager 3.1.2

Use Argo CD, a GitOps continuous delivery tool for Kubernetes, and IBM Multicloud Manager to achieve declarative and automated deployment of applications to multiple Kubernetes clusters.

Continue reading

February 11, 2019

Solving Business Problems with Splunk on IBM Cloud Kubernetes Service

In this tutorial, we will install Splunk Connect for Kubernetes into an existing Splunk instance. Splunk Connect for Kubernetes provides a way to import and search your Kubernetes logging, object, and metrics data in Splunk.

Continue reading

February 8, 2019

A How-To for Migrating Redis to IBM Cloud Databases for Redis

If you’re moving your data over to IBM Cloud Databases for Redis, you’ll need to take some steps to successfully migrate all of your data. We’ve got you covered. In this post, we’ll show you a quick way to start migrating your data across to Databases for Redis, whether your database is on-premise or in the cloud.

Continue reading