lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Santamauro <david.santama...@gmail.com>
Subject date difference faceting
Date Fri, 08 Jan 2016 10:23:58 GMT

Hi,

I have two date fields, d_a and d_b, both of type solr.TrieDateField, 
that represent different events associated with a particular document. 
The interval between these dates is relevant for corner-case statistics. 
The interval is calculated as the difference: sub(d_b,d_a) and I've been 
able to

   stats=true&stats.field={!func}sub(d_b,d_a)

What I ultimately would like to report is the interval represented as a 
range, which could be seen as facet.query

(pseudo code)
   facet.query=sub(d_b,d_a)[ * TO 86400000 ] // day
   facet.query=sub(d_b,d_a)[ 86400001 TO 604800000 ] // week
   facet.query=sub(d_b,d_a)[ 604800001 TO 2592000000 ] // month
etc.

Aside from actually indexing the difference in a separate field, is 
there something obvious I'm missing? I'm on SOLR 5.2 in cloud mode.

thanks
David

Mime
View raw message