I have a schema in which we are recording device registration time in field devRegDt_dt
.
Our service is storing device registration time in this field, and it gets stored in 2015-09-24T14:05:08Z
format.
We would like to create query which should provide result as: "2015-09-24" : 5
i.e. "DATE"
: <occurances>
Please note that we are ignoring time in this result and only considering date.
Just in case if this is duplicate, please help with related question.
Thanks.
You can faceting over date field.
Here is sample query:http://localhost:8888/solr/lws-map/select?q=*%3A*&wt=json&fl=id&indent=true&facet.range=**facetfield**&facet=true&facet.range.start=NOW-10YEAR&facet.range.end=NOW&facet.range.gap=%2B1MONTH
Above query facet over last 10 years documents and gap is 1 Month. if you want count day wise then change facet.range.gap to XXXDAY
Read more about solr date format at solr wiki.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With