Hey, That's because Solr just looks for one start,end and gap params in solrconfig.xml. It just allows you to do datefaceting for differents fields but just in one range period. I was in the same situation as you are, what I did was modify the function getFacetDateCounts() from Simplefacets.class to make it get as match params (stard/end/gap) as I want. Once it's done I do date faceting in all time periods. Result would look like:
<lst name="facet_dates"> <lst name="source_date"> <int name="2008-10-13T00:00:00Z">2238</int> <str name="gap">+3MONTH</str> <date name="end">2009-01-13T00:00:00Z</date> <int name="2008-07-13T00:00:00Z">3822</int> <str name="gap">+6MONTH</str> <date name="end">2009-01-13T00:00:00Z</date> <int name="2008-01-13T00:00:00Z">3864</int> <str name="gap">+1YEAR</str> <date name="end">2009-01-13T00:00:00Z</date> </lst> </lst> Doing facets for the last year, 6 month and 3 month. I don't think there's a way to do that without modifiying the source (if you find it let me know :D) prerna07 wrote: > > Hi, > > I have to create two facets on a date field: > 1) First Facet will have results between two date range , i.e. [NOW TO > NOW+45DAYS] > 2) Second Facet will have results between two date range , i.e. > [NOW-45DAYS TO NOW] > > I want both results in a single query. The query i am using is mentioned > below : > > &facet=true&facet.date=productPublicationDate_product_dt&f.productPublicationDate_product_dt.facet.date.start=NOW&f.productPublicationDate_product_dt.facet.date.end=NOW+45DAYS&f.productPublicationDate_product_dt.facet.date.gap=%2B45DAYS&facet.date=productPublicationDate_product_dt&f.productPublicationDate_product_dt.facet.date.start=NOW-45DAYS&f.productPublicationDate_product_dt.facet.date.end=NOW&f.productPublicationDate_product_dt.facet.date.gap=%2B45DAYS > > ISSUE: > I am getting same response in two nodes, one query is overriding the > response of second facet: > > - <lst name="facet_counts"> > <lst name="facet_queries" /> > <lst name="facet_fields" /> > - <lst name="facet_dates"> > - <lst name="productPublicationDate_product_dt"> > <int name="2009-01-13T08:37:26.662Z">0</int> > <str name="gap">+45DAYS</str> > <date name="end">2009-02-27T08:37:26.662Z</date> > </lst> > - <lst name="productPublicationDate_product_dt"> > <int name="2009-01-13T08:37:26.662Z">0</int> > <str name="gap">+45DAYS</str> > <date name="end">2009-02-27T08:37:26.662Z</date> > </lst> > </lst> > </lst> > > Please suggest the way by which i can differentiate these two facet.field > in the query ? > -- View this message in context: http://www.nabble.com/Issue-in-Facet-on-date-field-tp21431422p21431727.html Sent from the Solr - User mailing list archive at Nabble.com.