# Build "Google Trends" style dataset from ES

**URL:** <https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565>\
**Category:** Elasticsearch\
**Created:** [November 5, 2012, 5:52pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565 "2012-11-05T17:52:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesse\_heaslip](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesse_heaslip/32/2655_2.png) [@jesse\_heaslip](https://discuss.elastic.co/u/jesse_heaslip)\
**Post date:** [November 5, 2012, 5:52pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/1 "2012-11-05T17:52:45Z")

</div>

Hi All,

Total noob here. I have a set of tweets in elastic search and I want to be  
able to look up a group of words (word1, word2, word3 etc.) on each tweet  
for a group of twitter handles and extract a csv or JSON that shows just  
the count of words and a time stamp so I can visualize this sort of like  
Google Trends. Ideally, I would like to compare different groups of  
twitter handles to each other based on the groupings of words.

Any and all help super appreciated.

Thanks

Jesse

--

---

<div class="post-metadata">

**Author:** ![jesse\_heaslip](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesse_heaslip/32/2655_2.png) [@jesse\_heaslip](https://discuss.elastic.co/u/jesse_heaslip)\
**Post date:** [November 5, 2012, 6:11pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/2 "2012-11-05T18:11:08Z")

</div>

Or if someone could tell me how to use the count API with a JSON request  
like:

{  
"filtered" : {  
"query" : {  
"terms" : { "user.screen\_name" : ["user1", "user2"]}  
},  
"filter" : {  
"range" : {  
"created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01"  
}  
}  
}  
}  
}

I think that would solve the trick!

On Monday, November 5, 2012 9:52:45 AM UTC-8, jesse heaslip wrote:

> Hi All,
> 
> Total noob here. I have a set of tweets in Elasticsearch and I want to  
> be able to look up a group of words (word1, word2, word3 etc.) on each  
> tweet for a group of twitter handles and extract a csv or JSON that shows  
> just the count of words and a time stamp so I can visualize this sort of  
> like Google Trends. Ideally, I would like to compare different groups of  
> twitter handles to each other based on the groupings of words.
> 
> Any and all help super appreciated.
> 
> Thanks
> 
> Jesse

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 5, 2012, 8:46pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/3 "2012-11-05T20:46:01Z")

</div>

Did you try something like?  
$ curl -XGET '[http://localhost:9200/twitter/tweet/\_count](http://localhost:9200/twitter/tweet/_count)' -d '  
{  
"filtered" : {  
"query" : {  
"terms" : { "user.screen\_name" : ["user1", "user2"]}  
},  
"filter" : {  
"range" : {  
"created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
}  
}  
}  
}'

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 nov. 2012 à 19:11, jesse heaslip [jesse.heaslip@gmail.com](mailto:jesse.heaslip@gmail.com) a écrit :

Or if someone could tell me how to use the count API with a JSON request like:

{  
"filtered" : {  
"query" : {  
"terms" : { "user.screen\_name" : ["user1", "user2"]}  
},  
"filter" : {  
"range" : {  
"created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
}  
}  
}  
}

I think that would solve the trick!

On Monday, November 5, 2012 9:52:45 AM UTC-8, jesse heaslip wrote:

> Hi All,
> 
> Total noob here. I have a set of tweets in Elasticsearch and I want to be able to look up a group of words (word1, word2, word3 etc.) on each tweet for a group of twitter handles and extract a csv or JSON that shows just the count of words and a time stamp so I can visualize this sort of like Google Trends. Ideally, I would like to compare different groups of twitter handles to each other based on the groupings of words.
> 
> Any and all help super appreciated.
> 
> Thanks
> 
> Jesse

--

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 5, 2012, 8:47pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/4 "2012-11-05T20:47:50Z")

</div>

But you probably should look at facet feature.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 nov. 2012 à 21:46, David Pilato [david@pilato.fr](mailto:david@pilato.fr) a écrit :

Did you try something like?  
$ curl -XGET '[http://localhost:9200/twitter/tweet/\_count](http://localhost:9200/twitter/tweet/_count)' -d '  
{  
"filtered" : {  
"query" : {  
"terms" : { "user.screen\_name" : ["user1", "user2"]}  
},  
"filter" : {  
"range" : {  
"created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
}  
}  
}  
}'

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 nov. 2012 à 19:11, jesse heaslip [jesse.heaslip@gmail.com](mailto:jesse.heaslip@gmail.com) a écrit :

Or if someone could tell me how to use the count API with a JSON request like:

{  
"filtered" : {  
"query" : {  
"terms" : { "user.screen\_name" : ["user1", "user2"]}  
},  
"filter" : {  
"range" : {  
"created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
}  
}  
}  
}

I think that would solve the trick!

On Monday, November 5, 2012 9:52:45 AM UTC-8, jesse heaslip wrote:

> Hi All,
> 
> Total noob here. I have a set of tweets in Elasticsearch and I want to be able to look up a group of words (word1, word2, word3 etc.) on each tweet for a group of twitter handles and extract a csv or JSON that shows just the count of words and a time stamp so I can visualize this sort of like Google Trends. Ideally, I would like to compare different groups of twitter handles to each other based on the groupings of words.
> 
> Any and all help super appreciated.
> 
> Thanks
> 
> Jesse

--

--

--

---

<div class="post-metadata">

**Author:** ![jesse\_heaslip](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesse_heaslip/32/2655_2.png) [@jesse\_heaslip](https://discuss.elastic.co/u/jesse_heaslip)\
**Post date:** [November 5, 2012, 10:29pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/5 "2012-11-05T22:29:45Z")

</div>

Sadly can't seem get localhost up and running on my machine... like I said,  
total noob. I have been using the elasticsearch-head. Any advice on where  
to go to get local host running and then I can start to run some of these  
queries through terminal?

Thanks for all your help!

On Monday, November 5, 2012 12:46:06 PM UTC-8, David Pilato wrote:

> Did you try something like?
> 
> $ curl -XGET '[http://localhost:9200/twitter/tweet/\_count](http://localhost:9200/twitter/tweet/_count)' -d '  
> {  
> "filtered" : {  
> "query" : {  
> "terms" : { "user.screen\_name" : ["user1", "user2"]}  
> },  
> "filter" : {  
> "range" : {  
> "created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
> }  
> }  
> }  
> }'
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 5 nov. 2012 à 19:11, jesse heaslip \<[jesse....@gmail.com](mailto:jesse....@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Or if someone could tell me how to use the count API with a JSON request  
> like:
> 
> {  
> "filtered" : {  
> "query" : {  
> "terms" : { "user.screen\_name" : ["user1", "user2"]}  
> },  
> "filter" : {  
> "range" : {  
> "created\_at" : { "from" : "2012-09-01", "to" :  
> "2012-11-01" }  
> }  
> }  
> }  
> }
> 
> I think that would solve the trick!
> 
> On Monday, November 5, 2012 9:52:45 AM UTC-8, jesse heaslip wrote:
> 
> > Hi All,
> > 
> > Total noob here. I have a set of tweets in Elasticsearch and I want to  
> > be able to look up a group of words (word1, word2, word3 etc.) on each  
> > tweet for a group of twitter handles and extract a csv or JSON that shows  
> > just the count of words and a time stamp so I can visualize this sort of  
> > like Google Trends. Ideally, I would like to compare different groups of  
> > twitter handles to each other based on the groupings of words.
> > 
> > Any and all help super appreciated.
> > 
> > Thanks
> > 
> > Jesse
> 
> --

--

---

<div class="post-metadata">

**Author:** ![jesse\_heaslip](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesse_heaslip/32/2655_2.png) [@jesse\_heaslip](https://discuss.elastic.co/u/jesse_heaslip)\
**Post date:** [November 5, 2012, 10:43pm UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/6 "2012-11-05T22:43:47Z")

</div>

NVM. Local host on the go. Thanks for you help

On Monday, November 5, 2012 2:29:45 PM UTC-8, jesse heaslip wrote:

> Sadly can't seem get localhost up and running on my machine... like I  
> said, total noob. I have been using the elasticsearch-head. Any advice on  
> where to go to get local host running and then I can start to run some of  
> these queries through terminal?
> 
> Thanks for all your help!
> 
> On Monday, November 5, 2012 12:46:06 PM UTC-8, David Pilato wrote:
> 
> > Did you try something like?
> > 
> > $ curl -XGET '[http://localhost:9200/twitter/tweet/\_count](http://localhost:9200/twitter/tweet/_count)' -d '  
> > {  
> > "filtered" : {  
> > "query" : {  
> > "terms" : { "user.screen\_name" : ["user1", "user2"]}  
> > },  
> > "filter" : {  
> > "range" : {  
> > "created\_at" : { "from" : "2012-09-01", "to" : "2012-11-01" }  
> > }  
> > }  
> > }  
> > }'
> > 
> > HTH
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 5 nov. 2012 à 19:11, jesse heaslip [jesse....@gmail.com](mailto:jesse....@gmail.com) a écrit :
> > 
> > Or if someone could tell me how to use the count API with a JSON request  
> > like:
> > 
> > {  
> > "filtered" : {  
> > "query" : {  
> > "terms" : { "user.screen\_name" : ["user1", "user2"]}  
> > },  
> > "filter" : {  
> > "range" : {  
> > "created\_at" : { "from" : "2012-09-01", "to" :  
> > "2012-11-01" }  
> > }  
> > }  
> > }  
> > }
> > 
> > I think that would solve the trick!
> > 
> > On Monday, November 5, 2012 9:52:45 AM UTC-8, jesse heaslip wrote:
> > 
> > > Hi All,
> > > 
> > > Total noob here. I have a set of tweets in Elasticsearch and I want to  
> > > be able to look up a group of words (word1, word2, word3 etc.) on each  
> > > tweet for a group of twitter handles and extract a csv or JSON that shows  
> > > just the count of words and a time stamp so I can visualize this sort of  
> > > like Google Trends. Ideally, I would like to compare different groups of  
> > > twitter handles to each other based on the groupings of words.
> > > 
> > > Any and all help super appreciated.
> > > 
> > > Thanks
> > > 
> > > Jesse
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:06am UTC](https://discuss.elastic.co/t/build-google-trends-style-dataset-from-es/9565/7 "2017-07-06T03:06:07Z")

</div>


