Hi all,
I'm trying to do a Date Facet, but running into a problem. The following code:
new SolrFacetDateQuery("proposal_submission_date", new DateTime(2004, 1, 1), new DateTime(DateTime.Now.Year, 1, 1), "+1YEARS")
{
HardEnd = true,
Other = new[] { FacetDateOther.After, FacetDateOther.Before }
});
I wasn't getting any FacetDate items in the response, so I inspected the URL via Fiddler and discovered that the URL generated for the request is shown below:
http://<server>/solr/<core>/select?q=*&start=0&rows=10&fl=proposal_submission_date&facet=true
&facet.date=proposal_submission_date
&f.proposal_submission_date.facet.date.start=2004-01-01T00%3a00%3a00Z
&f.proposal_submission_date.facet.date.end=2017-01-01T00%3a00%3a00Z
&f.proposal_submission_date.facet.date.gap=%2b1YEARS
&f.proposal_submission_date.facet.date.hardend=true
&f.proposal_submission_date.facet.date.other=after
&f.proposal_submission_date.facet.date.other=before
&facet.limit=-1&debugQuery=true&version=2.2
However, it returns no date facets and the facet range XML in the raw response are blank as well.
When I modify the URL from "facet.date" to "facet.range" then everything works as expected.
http://<server>/solr/<core>/select?q=*&start=0&rows=10&fl=proposal_submission_date&facet=true
&facet.range=proposal_submission_date
&f.proposal_submission_date.facet.range.start=2004-01-01T00%3a00%3a00Z
&f.proposal_submission_date.facet.range.end=2017-01-01T00%3a00%3a00Z
&f.proposal_submission_date.facet.range.gap=%2b1YEARS
&f.proposal_submission_date.facet.range.hardend=true
&f.proposal_submission_date.facet.range.other=after
&f.proposal_submission_date.facet.range.other=before
&facet.limit=-1&debugQuery=true&version=2.2
The raw XML returned from this URL includes all of the date ranges as specified and works as I expected the SolrFacetDateQuery to work.
Also, the Solr 6.6 documentation doesn't show "facet.date" URL parameters, which is why I tried (and discovered) facet.range works.
Should I be doing something differently?
Using SolrNet 0.7.1
Solr 6.6
thanks,
Jim