You can get at some of this functionality in the built-in xslt 1.0 engine (Xalan) by using the e-xslt date-time extensions: see http://exslt.org/date/index.html, and for Xalan's implementation see http://xml.apache.org/xalan-j/extensionslib.html#exslt . There are some examples here: http://www-128.ibm.com/developerworks/library/x-exslt.html . I haven't tried this in Solr but I don't think there's any reason why it wouldn't work; I've used it in other Xalan-J environments, notably Cocoon.
Peter -----Original Message----- From: Brian Whitman [mailto:[EMAIL PROTECTED] Sent: Thursday, May 10, 2007 11:49 AM To: solr-user@lucene.apache.org Subject: Re: dates & times > > Those are interesting ideas and it probably would not be difficult to > create a patch if you were interested, but I'm curious: What about > XSL makes what seems to me an elementary string-processing task so > difficult? > Well, XSL 1.0 (which is the one that "comes for free" with Solr/java) doesn't handle dates and times at all. XSL 2.0 handles it well enough, but it's only supported through a GPL jar, which we can't distribute. It's more than string processing, anyway. I would want to convert the Solr Time 2007-03-15T00:41:5:2Z to "March 15th, 2007" in a web app. I'd also like to say 'Posted 3 days ago." In my vision of things, that work is done on Solr's side. (The former case with a strftime type formatter in solrconfig, the latter by having strftime return the day number this year.)