[ https://issues.apache.org/jira/browse/SOLR-13645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16889699#comment-16889699 ]
Neal Sidhwaney commented on SOLR-13645: --------------------------------------- I removed the use of the APIs that didn't take locales and added ones that called getDefaultLocale. I spent some time making a patch that took the locale as a parameter (so it would add another parameter to the analytics function call from the client) but decided against it for a couple reasons: * The locale for date formatting really only makes sense in the context of using the Java short/medium/long styles, but not when the user is being explicit about the format string. * It ends up exposing more of the Java date interface through the analytics interface It's a judgement call, but, in my opinion, it simplifies the interface and parameters can be added later on if it's deemed necessary to support. Happy to discuss further if anyone feels it should be done differently. > Add analytics function to format/extract components from dates > -------------------------------------------------------------- > > Key: SOLR-13645 > URL: https://issues.apache.org/jira/browse/SOLR-13645 > Project: Solr > Issue Type: New Feature > Security Level: Public(Default Security Level. Issues are Public) > Affects Versions: 8.1.1 > Reporter: Neal Sidhwaney > Priority: Minor > Attachments: SOLR-13645-Analytics-function-for-date-components.patch, > SOLR-13645-Analytics-function-for-date-components.patch > > > It's helpful when running analytics to be able to do manipulation on dates > such as extracting month/day/year, converting to th week of year, etc, and > other formatting as many existing libraries provide. I have a patch going > through final testing that will add this to the analytcs library. > One thing I'm sort of amibvialent about is that it exposes that we use Java > date parsing in the analytics function, because the syntax is the same format > string that SimpleDateFormat accepts. Ideally there would be an abstraction > between the analytics language and what's used on the backend to implement > it. On the other hand, implementing a syntax for time/date formatting is > something that's been done many many times before, and this is not the only > place where Java date particulars show through. It would be good to revisit > this at a later time. > > > -- This message was sent by Atlassian JIRA (v7.6.14#76016) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org