Creating heatmapjs using elasticsearch database

I'm trying to make a new heatmapjs using data from twitter-river
elasticsearch. I can extract geolocation from Twitter data, but how do I
pass the data the heatmapjs. Here is sample dataset from heatmapjs:

var testData = {
max: 8,
data: [{lat: 24.6408, lng:46.7728, count: 3},{lat: 50.75, lng:-1.55, count: 1},{lat: 52.6333, lng:1.75, count: 1},{lat: 48.15, lng:9.4667, count: 1},{lat: 52.35, lng:4.9167, count: 2},{lat: 60.8, lng:11.1, count: 1},{lat: 43.561, lng:-116.214, count: 1},{lat: 47.5036, lng:-94.685, count: 1},{lat: 42.1818, lng:-71.1962, count: 1},{lat: 42.0477, lng:-74.1227, count: 1},{lat: 40.0326, lng:-75.719, count: 1},{lat: 40.7128, lng:-73.2962, count: 2}]
};

 heatmap.setData(testData);

How can I parse data from elasticsearch queries to dataset?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/464d96b1-dbca-45b7-b4df-ee1285f2e10d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.