You might find this useful. If makes creating time series aggregations a little easier. It uses JSON facets under the covers and is very fast.
https://lucene.apache.org/solr/guide/7_6/stream-source-reference.html#timeseries Joel Bernstein http://joelsolr.blogspot.com/ On Wed, Jun 19, 2019 at 1:34 PM Erick Erickson <erickerick...@gmail.com> wrote: > There are two approaches I might use, which is really up to you. > > - You can do a regex filter. So define your extra fields as you want, then > use a regex charFilter (NOT filter, you want to transform the entire input) > to peel out the separate parts. Then copyfield to each one, each with a > different regex to peel out the correct part. > > - use a ScriptUpdateProcessor to do whatever you want in the scripting > language you’re most comfortable with. Note that the SolrDocument that’s > handled by a SUP is just a map of key:value pairs and you can modify it as > you see fit. > > Best, > Erick > > > On Jun 19, 2019, at 10:25 AM, Nightingale, Jonathan A (US) < > jonathan.nighting...@baesystems.com> wrote: > > > > Hi all, > > I'm trying to have a date field automatically generate some facets of > itself, like hour of the day and hour of the week as examples, when its > stored. I was looking at this tutorial and it deemed to almost do what I > wanted > > > > https://nathanfriend.io/2017/06/26/smart-date-searching-with-solr.html > > > > I was wondering if there was a way to use these filters and tokenizers > to generate values for different fields. Maybe in conjunction with a > copyfield? > > > > I'd like it to work whenever a *_c (calendar) field is indexed it also > indexes the hour of the day (hod_d) and hor of week (how_d) fields as well. > > > > Any thoughts? > > > > Thanks! > >