Hi all,
I am using solr 6.5.0, and I want to do pivot faceting including a date
field. My simple facet.json is:
{
"dates": {
"type": "range",
"field": "observationStart.TimeOP",
"start": "3000-01-01T00:00:00Z",
"end": "3000-01-02T00:00:00Z",
"gap": "%2B15MINUTE",
"facet": {
"x": "sum(trafficCnt)"
}
}
}
What I get back is an error though:
error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"Unable to range facet on
field:observationStart.TimeOP{type=date_range,properties=indexed,stored,omitTermFreqAndPositions,useDocValuesAsStored}"
On the other hand, if I use the old interface, it seems to work:
"facet":"on",
"facet.range.start":"3000-01-01T00:00:00Z",
"facet.range.end":"3000-01-01T00:00:00Z+1DAY"
"facet.range.gap":"+15MINUTE"
I get:
"facet_ranges":{
"observationStart.TimeOP":{
"counts":[
"3000-01-01T00:00:00Z",258,
"3000-01-01T00:15:00Z",261,
"3000-01-01T00:30:00Z",258,
"3000-01-01T00:45:00Z",254,
...
My date fields are of type solr.DateRangeField.
Searching for the error I get, I found this source file:
https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java
Where in line 180 it has "if (ft instanceof TrieField || ft.isPointField()".
Is it related to my problem? Is the new json facet interface not working
with date ranges?
Regards,
George