You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2013/04/27 20:26:15 UTC

[jira] [Commented] (SOLR-4772) DateRoundingUpdateProcessorFactory

    [ https://issues.apache.org/jira/browse/SOLR-4772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13643755#comment-13643755 ] 

Hoss Man commented on SOLR-4772:
--------------------------------

Great idea for an UPF, some feedback on the attachment...

1) i'm not a fan of assuming rounding by "year" by default ... i think it would be better to require an explict rounding param, but if it is going to have a default, "day" seems like a more generally usable default then year
2) extending FieldValueMutatingUpdateProcessor instead of FieldMutatingUpdateProcessor would eliminate some redundency in looping over hte values and dealing with the boost.
3) we can't assume the field values can be cast to String -- if they come from SolrJ (or an upstream processor like TimestampUpdateProcessor) it might already be a Date object.  If it's neither a Date obj, or can't be parsed as a Date, we need either an explicit error check, or we should ignore the value and pass it through (ant let a downstream processor or the schema complain about it)
4) likewise once we've got a date object, it's not really necessary to reformat as a String
5) the DateFormat used isn't thread safe so there will be problems with concurrent updates
6) the DateFormat doesn't handle the full date syntax -- particularly ms, or the possibility that the date is already a math expression (like "NOW")

5 & 6 can both be dealt with easily by having a private instance of "new DateField()" and calling "parseMath(null, value)"


                
> DateRoundingUpdateProcessorFactory
> ----------------------------------
>
>                 Key: SOLR-4772
>                 URL: https://issues.apache.org/jira/browse/SOLR-4772
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>            Reporter: Upayavira
>            Priority: Minor
>         Attachments: DateRoundingUpdateProcessorFactory.zip
>
>
> A simple UpdateProcessor that rounds dates using the DateMathParser.
> At present it is not possible to combine pivot faceting with range queries. This simple UpdateProcessor allows us to round our dates on their way into Solr, giving us date fields that can be used in pivot facets.
> This can be extremely useful when using facets to plot graphs based upon log files indexed into Solr.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org