# Grouping most used terms by geohash\_grid and date

**URL:** <https://discuss.elastic.co/t/grouping-most-used-terms-by-geohash-grid-and-date/22421>\
**Category:** Elasticsearch\
**Created:** [February 26, 2015, 10:56pm UTC](https://discuss.elastic.co/t/grouping-most-used-terms-by-geohash-grid-and-date/22421 "2015-02-26T22:56:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandre\_klein](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@alexandre\_klein](https://discuss.elastic.co/u/alexandre_klein)\
**Post date:** [February 26, 2015, 10:56pm UTC](https://discuss.elastic.co/t/grouping-most-used-terms-by-geohash-grid-and-date/22421/1 "2015-02-26T22:56:55Z")

</div>

Hello,

I am facing a problème and i don't really undestand why.

I am storing tweets and i want to know, day by day what are the "trending  
topics" of the day, by localisation.

When i try this request :

curl -XGET [http://localhost:9200/twitter/\_search](http://localhost:9200/twitter/_search) -d '{  
"query":{  
"match\_all":{

```
  }

```

},  
"filter":{  
"range":{  
"created\_at":{  
"from":"Mon Feb 23 00:00:00 +0000 2015",  
"to":"Wed Feb 23 23:59:59 +0000 2015"  
}  
}  
},  
"aggs":{  
"geo1":{  
"geohash\_grid":{  
"field":"geo",  
"precision":5  
},  
"aggs":{  
"tags":{  
"terms":{  
"field":"text",  
"size":10  
}  
}  
}  
}  
}  
}'

The time filter is not used.

It is not the proper way to use the filter in an agggregation ?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bcbd34be-4fae-4bf2-bbb1-016d02c27def%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcbd34be-4fae-4bf2-bbb1-016d02c27def%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 27, 2015, 6:01am UTC](https://discuss.elastic.co/t/grouping-most-used-terms-by-geohash-grid-and-date/22421/2 "2015-02-27T06:01:55Z")

</div>

You should use a filteredQuery.

> **[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.

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

> Le 26 févr. 2015 à 23:56, [alexandre.klein@instantluxe.com](mailto:alexandre.klein@instantluxe.com) a écrit :
> 
> Hello,
> 
> I am facing a problème and i don't really undestand why.
> 
> I am storing tweets and i want to know, day by day what are the "trending topics" of the day, by localisation.
> 
> When i try this request :
> 
> curl -XGET [http://localhost:9200/twitter/\_search](http://localhost:9200/twitter/_search) -d '{  
> "query":{  
> "match\_all":{
> 
> ```
> }
> 
> ```
> 
> },  
> "filter":{  
> "range":{  
> "created\_at":{  
> "from":"Mon Feb 23 00:00:00 +0000 2015",  
> "to":"Wed Feb 23 23:59:59 +0000 2015"  
> }  
> }  
> },  
> "aggs":{  
> "geo1":{  
> "geohash\_grid":{  
> "field":"geo",  
> "precision":5  
> },  
> "aggs":{  
> "tags":{  
> "terms":{  
> "field":"text",  
> "size":10  
> }  
> }  
> }  
> }  
> }  
> }'
> 
> The time filter is not used.
> 
> ## It is not the proper way to use the filter in an agggregation ?
> 
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bcbd34be-4fae-4bf2-bbb1-016d02c27def%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bcbd34be-4fae-4bf2-bbb1-016d02c27def%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/E8A5364C-2C71-4FD8-A328-23DBA1BC3CAF%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/E8A5364C-2C71-4FD8-A328-23DBA1BC3CAF%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:29am UTC](https://discuss.elastic.co/t/grouping-most-used-terms-by-geohash-grid-and-date/22421/3 "2017-07-06T00:29:39Z")

</div>


