Top ten urls with elasticsearch

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You need to use:

A Range Filter: 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

I would recommend reading as well: http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_ranges.html

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit 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.

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 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
A Terms aggregation:
Elasticsearch Platform — Find real-time answers at scale | Elastic

I would recommend reading as well:
Elasticsearch Platform — Find real-time answers at scale | Elastic

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.comhttps://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.

--
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/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen (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 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
A 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

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit 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.

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
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen (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 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
A Terms aggregation:
Elasticsearch Platform — Find real-time answers at scale | Elastic

I would recommend reading as well:
Elasticsearch Platform — Find real-time answers at scale | Elastic

HTH

 -- 

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.comhttps://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.

--
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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.comhttps://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.

--
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/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 17:51:28, Ha Lan Quyen (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
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen (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 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
A 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

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit 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.

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
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 17:51:28, Ha Lan Quyen (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
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 16:00:45, Ha Lan Quyen (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 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
A Terms aggregation:
Elasticsearch Platform — Find real-time answers at scale | Elastic

I would recommend reading as well:
Elasticsearch Platform — Find real-time answers at scale | Elastic

HTH

 -- 

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 7 mai 2014 à 12:29:00, Ha Lan Quyen (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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/84c29638-18ad-48b9-b0d2-8e0e2ef500b7%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/aea24f73-b57a-4e74-86ab-2cf33099a429%40googlegroups.comhttps://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.

--
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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5caa5622-d4b3-4ce5-921a-b3e5a722cfef%40googlegroups.comhttps://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.

--
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/49011b5d-3c51-4e73-96a6-88eb33ae875f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.