How about a field indextime_dt filled with "NOW". Then do a facet query to get the montly stats last 12 months: http://localhost:8983/solr/select/?q=*:*&rows=0&facet=true&facet.date=indextime_dt&facet.date.start=NOW/MONTH-12MONTHS&facet.date.end=NOW/MONTH%2B1MONTH&facet.date.gap=%2B1MONTH
To get min date, why not do a query sorted by index time and pull the timestamp from first hit? http://localhost:8983/solr/select/?q=*:*&rows=1&fl=indextime_dt&sort=indextime_dt+asc -- Jan Høydahl - search architect Cominvent AS - www.cominvent.com On 10. feb. 2010, at 14.12, Mark N wrote: > How can we get the max and min date from the Solr index ? I would need these > dates to draw a graph ( for example timeline graph ) > > > Also can we use date faceting to show how many documents are indexed every > month . > Consider I need to draw a timeline graph for current year to show how many > records are indexed for every month .So i will have months in X axis and no > of document in Y axis. > > What should be the better approach to design a schema to achieve this > functionality ? > > > Any suggestions would be appreciated > > thanks > > > -- > Nipen Mark