Which version are you using? I remember addressing this issue, but it may have been in Alfresco's version of Solr and never got ported back.
I do agree that in a time series a null value is not what people want. It is a very small change to populate with zeros if it has not already been done in the latest versions. Joel Bernstein http://joelsolr.blogspot.com/ On Mon, Sep 3, 2018 at 8:58 AM Jan Høydahl <jan....@cominvent.com> wrote: > Hi > > We have a timeseries expression with gap="+1DAY" and a sum(imps_l) to > aggregate sums of an integer for each bucket. > Now, some day buckets do not contain any documents at all, and instead of > returning a tuple with value 0, it returns > a tuple with no entry at all for the sum, see the bucket for date_dt > 2018-06-22 below: > > { > "result-set": { > "docs": [ > { > "sum(imps_l)": 0, > "date_dt": "2018-06-21", > "count(*)": 5 > }, > { > "date_dt": "2018-06-22", > "count(*)": 0 > }, > { > "EOF": true, > "RESPONSE_TIME": 3 > } > ] > } > } > > > Now when we want to convert this into a column using col(a,'sum(imps_l)') > then that array will get mostly numbers > but also some string entries 'sum(imps_l)' which is the key name. I need > purely integers in the column. > > Should the timeseries() have output values for all functions even if there > are no documents in the bucket? > Or is there something similar to the select() expression that can take a > stream of tuples not originating directly > from search() and replace values? Or is there perhaps a function that can > loop through the column produced by col() > and replace non-numeric values with 0? > > -- > Jan Høydahl, search solution architect > Cominvent AS - www.cominvent.com > >