# Top ten urls with elasticsearch

**URL:** <https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388>\
**Category:** Elasticsearch\
**Created:** [May 7, 2014, 10:28am UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388 "2014-05-07T10:28:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ha\_Lan\_Quyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ha_lan_quyen/32/1585_2.png) [@Ha\_Lan\_Quyen](https://discuss.elastic.co/u/Ha_Lan_Quyen)\
**Post date:** [May 7, 2014, 10:28am UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/1 "2014-05-07T10:28:54Z")

</div>

Hi everyone,

I just begin to use elasticsearch for report. When have a request access to  
my website then I will index that by using elasticsearch with some  
information like: url, date, host.. and now i want to get top 10 urls from  
start date to finish date.

E.g: get 10 urls ordered by the access number of request from 2014/05/01 to  
2014/05/30.

So how can I do it with elasticsearch?  
Thanks

--  
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/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%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:** [May 7, 2014, 10:51am UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/2 "2014-05-07T10:51:46Z")

</div>

You need to use:

A Range Filter: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
A Terms aggregation: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)

I would recommend reading as well: [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/\_ranges.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)

HTH

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dangokuson@gmail.com](mailto:dangokuson@gmail.com)) a écrit:

Hi everyone,

I just begin to use elasticsearch for report. When have a request access to my website then I will index that by using elasticsearch with some information like: url, date, host.. and now i want to get top 10 urls from start date to finish date.

E.g: get 10 urls ordered by the access number of request from 2014/05/01 to 2014/05/30.

## So how can I do it with elasticsearch? Thanks

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/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%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/etPan.536a1042.2eb141f2.8781%40air-de-david.esprit.tn](https://groups.google.com/d/msgid/elasticsearch/etPan.536a1042.2eb141f2.8781%40air-de-david.esprit.tn).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ha\_Lan\_Quyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ha_lan_quyen/32/1585_2.png) [@Ha\_Lan\_Quyen](https://discuss.elastic.co/u/Ha_Lan_Quyen)\
**Post date:** [May 7, 2014, 2:00pm UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/3 "2014-05-07T14:00:39Z")

</div>

Thanks David Pilato,

I tried to use terms aggregations but it always returned the doc\_count is 1  
even that url has been indexed many times.

E.g: the url [http://localhost:8080/test-es/en/elasticsearch](http://localhost:8080/test-es/en/elasticsearch) has been  
indexed 5 times. but the doc\_count of terms aggregation for that url just  
return 1

Thanks

On Wednesday, May 7, 2014 5:51:46 PM UTC+7, David Pilato wrote:

> You need to use:
> 
> A Range Filter:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
> A Terms aggregation:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)
> 
> I would recommend reading as well:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)
> 
> HTH
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Hi everyone,
> 
> I just begin to use elasticsearch for report. When have a request access  
> to my website then I will index that by using elasticsearch with some  
> information like: url, date, host.. and now i want to get top 10 urls from  
> start date to finish date.
> 
> E.g: get 10 urls ordered by the access number of request from 2014/05/01  
> to 2014/05/30.
> 
> ## So how can I do it with elasticsearch? Thanks
> 
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> 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/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%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:** [May 7, 2014, 3:17pm UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/4 "2014-05-07T15:17:31Z")

</div>

It means that you have updated the same document five times because you are using the same \_id.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen ([dangokuson@gmail.com](mailto:dangokuson@gmail.com)) a écrit:

Thanks David Pilato,

I tried to use terms aggregations but it always returned the doc\_count is 1 even that url has been indexed many times.

E.g: the url [http://localhost:8080/test-es/en/elasticsearch](http://localhost:8080/test-es/en/elasticsearch) has been indexed 5 times. but the doc\_count of terms aggregation for that url just return 1

Thanks

On Wednesday, May 7, 2014 5:51:46 PM UTC+7, David Pilato wrote:  
You need to use:

A Range Filter: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
A Terms aggregation: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)

I would recommend reading as well: [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/\_ranges.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)

HTH

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:

Hi everyone,

I just begin to use elasticsearch for report. When have a request access to my website then I will index that by using elasticsearch with some information like: url, date, host.. and now i want to get top 10 urls from start date to finish date.

E.g: get 10 urls ordered by the access number of request from 2014/05/01 to 2014/05/30.

## So how can I do it with elasticsearch? Thanks

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%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/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%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/etPan.536a4e8b.643c9869.92bf%40air-de-david.esprit.tn](https://groups.google.com/d/msgid/elasticsearch/etPan.536a4e8b.643c9869.92bf%40air-de-david.esprit.tn).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ha\_Lan\_Quyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ha_lan_quyen/32/1585_2.png) [@Ha\_Lan\_Quyen](https://discuss.elastic.co/u/Ha_Lan_Quyen)\
**Post date:** [May 7, 2014, 3:51pm UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/5 "2014-05-07T15:51:23Z")

</div>

Yep David,

What the expectation in this case is it will be returned doc\_count for that  
url is 5. Because that url has been indexed 5 times.

On Wednesday, May 7, 2014 10:17:31 PM UTC+7, David Pilato wrote:

> It means that you have updated the same document five times because you  
> are using the same \_id.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 7 mai 2014 à 16:00:45, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Thanks David Pilato,
> 
> I tried to use terms aggregations but it always returned the doc\_count is  
> 1 even that url has been indexed many times.
> 
> E.g: the url [http://localhost:8080/test-es/en/elasticsearch](http://localhost:8080/test-es/en/elasticsearch) has been  
> indexed 5 times. but the doc\_count of terms aggregation for that url just  
> return 1
> 
> Thanks
> 
> On Wednesday, May 7, 2014 5:51:46 PM UTC+7, David Pilato wrote:
> 
> > You need to use:
> > 
> > A Range Filter:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
> > A Terms aggregation:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)
> > 
> > I would recommend reading as well:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)
> > 
> > HTH
> > 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:
> > 
> > Hi everyone,
> > 
> > I just begin to use elasticsearch for report. When have a request access  
> > to my website then I will index that by using elasticsearch with some  
> > information like: url, date, host.. and now i want to get top 10 urls from  
> > start date to finish date.
> > 
> > E.g: get 10 urls ordered by the access number of request from 2014/05/01  
> > to 2014/05/30.
> > 
> > ## So how can I do it with elasticsearch? Thanks
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > 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/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%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:** [May 7, 2014, 4:53pm UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/6 "2014-05-07T16:53:13Z")

</div>

Just index the same document with another ID (or without any ID using a POST /index/type)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 17:51:28, Ha Lan Quyen ([dangokuson@gmail.com](mailto:dangokuson@gmail.com)) a écrit:

Yep David,

What the expectation in this case is it will be returned doc\_count for that url is 5. Because that url has been indexed 5 times.

On Wednesday, May 7, 2014 10:17:31 PM UTC+7, David Pilato wrote:  
It means that you have updated the same document five times because you are using the same \_id.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:

Thanks David Pilato,

I tried to use terms aggregations but it always returned the doc\_count is 1 even that url has been indexed many times.

E.g: the url [http://localhost:8080/test-es/en/elasticsearch](http://localhost:8080/test-es/en/elasticsearch) has been indexed 5 times. but the doc\_count of terms aggregation for that url just return 1

Thanks

On Wednesday, May 7, 2014 5:51:46 PM UTC+7, David Pilato wrote:  
You need to use:

A Range Filter: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
A Terms aggregation: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)

I would recommend reading as well: [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/\_ranges.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)

HTH

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:

Hi everyone,

I just begin to use elasticsearch for report. When have a request access to my website then I will index that by using elasticsearch with some information like: url, date, host.. and now i want to get top 10 urls from start date to finish date.

E.g: get 10 urls ordered by the access number of request from 2014/05/01 to 2014/05/30.

## So how can I do it with elasticsearch? Thanks

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%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/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%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/etPan.536a64fa.643c9869.944f%40air-de-david.esprit.tn](https://groups.google.com/d/msgid/elasticsearch/etPan.536a64fa.643c9869.944f%40air-de-david.esprit.tn).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ha\_Lan\_Quyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ha_lan_quyen/32/1585_2.png) [@Ha\_Lan\_Quyen](https://discuss.elastic.co/u/Ha_Lan_Quyen)\
**Post date:** [May 8, 2014, 1:55am UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/7 "2014-05-08T01:55:48Z")

</div>

Thanks

On Wednesday, May 7, 2014 11:53:13 PM UTC+7, David Pilato wrote:

> Just index the same document with another ID (or without any ID using a  
> POST /index/type)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 7 mai 2014 à 17:51:28, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Yep David,
> 
> What the expectation in this case is it will be returned doc\_count for  
> that url is 5. Because that url has been indexed 5 times.
> 
> On Wednesday, May 7, 2014 10:17:31 PM UTC+7, David Pilato wrote:
> 
> > It means that you have updated the same document five times because you  
> > are using the same \_id.
> > 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 7 mai 2014 à 16:00:45, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:
> > 
> > Thanks David Pilato,
> > 
> > I tried to use terms aggregations but it always returned the doc\_count is  
> > 1 even that url has been indexed many times.
> > 
> > E.g: the url [http://localhost:8080/test-es/en/elasticsearch](http://localhost:8080/test-es/en/elasticsearch) has been  
> > indexed 5 times. but the doc\_count of terms aggregation for that url just  
> > return 1
> > 
> > Thanks
> > 
> > On Wednesday, May 7, 2014 5:51:46 PM UTC+7, David Pilato wrote:
> > 
> > > You need to use:
> > > 
> > > A Range Filter:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)  
> > > A Terms aggregation:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation)
> > > 
> > > I would recommend reading as well:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html)
> > > 
> > > HTH
> > > 
> > > ```
> > > -- 
> > > 
> > > ```
> > > 
> > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > 
> > > Le 7 mai 2014 à 12:29:00, Ha Lan Quyen ([dango...@gmail.com](mailto:dango...@gmail.com)) a écrit:
> > > 
> > > Hi everyone,
> > > 
> > > I just begin to use elasticsearch for report. When have a request access  
> > > to my website then I will index that by using elasticsearch with some  
> > > information like: url, date, host.. and now i want to get top 10 urls from  
> > > start date to finish date.
> > > 
> > > E.g: get 10 urls ordered by the access number of request from 2014/05/01  
> > > to 2014/05/30.
> > > 
> > > ## So how can I do it with elasticsearch? Thanks
> > > 
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > 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/49011b5d-3c51-4e73-96a6-88eb33ae875f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49011b5d-3c51-4e73-96a6-88eb33ae875f%40googlegroups.com).  
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, 1:30am UTC](https://discuss.elastic.co/t/top-ten-urls-with-elasticsearch/17388/8 "2017-07-06T01:30:55Z")

</div>


