Thanks Ahmet that worked! Here's another issues I have :
Like I said before, I have these fields in Solr documents FirstName LastName RecruitedDate VolumeDate (just added this in this email) VolumeDone (just added this in this email) Now I have to get sum of all VolumeDone (integer field) for this month by everyone, then take 25% of that number and get all people whose volume was more than that. Is there a way to do this? :D I did some research but I wasn't able to come up with an answer. Thanks, Moazzam On Tue, Aug 10, 2010 at 1:42 PM, Ahmet Arslan <iori...@yahoo.com> wrote: >> I have a solr index whose documents have the following >> fields: >> >> FirstName >> LastName >> RecruitedDate >> >> I update the index when any of the three fields change for >> that specific person. >> >> I need to get facets based on when someone was recruited. >> The facets are : >> >> Recruited within 1 month >> Recruited within 3 months >> ... >> >> So if 10 people were recruited within the past month then >> the count >> for r"Recruited within 1 month" will be 10. >> >> Is there a way to calculate the facets from RecruitedDate? > > It is possible with facet.query; something like: > > q=*:*&facet=on&facet.query=RecruitedDate:[NOW-1MONTH TO > NOW]&facet.query=RecruitedDate:[NOW-3MONTHS TO NOW] > > > >