Hi, We are doing this via interval facet: Something like this: facet=on& facet.interval=update_date& facet.interval.set=[NOW-1DAY,NOW]& facet.interval.set=[NOW-3DAY,NOW-1DAY)& facet.interval.set=[NOW-7DAY,NOW-3DAY)& facet.interval.set=[NOW-1MONTH,NOW-7DAY)& facet.interval.set=[NOW-1YEAR,NOW-1MONTH)
I do not know if this is a correct way of doing this, but I did not find anything better. Here is link for interval faceting in wiki: https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-IntervalFaceting Hope this helps. Pavel ne 24. 1. 2016 v 17:20 odesílatel Jay Potharaju <jspothar...@gmail.com> napsal: > Hi, > I am trying to calculate facet for update_date of the document. And would > like to get the following values > - < 24 Hrs > - < 3 days > - < 1 week > - < 1 month > - < 6 months > - <1 year > > <field name="update_date" type="tdate" indexed="true" stored="true" > required="true" multiValued="false" docValues="true"/> > > The above facet values should change every time someone queries, therefore > a document that was updated today will show will be in the facet "24 hrs" > and when the same query runs 2 weeks from today, the document will be > marked as "< 1 month". > > How can I set my facets to get the above values? > > -- > Thanks > Jay >