Solr Date Format

2015-11-25 Thread Salman Ansari
Hi,

I was exploring Solr date formats and came across the following link
https://cwiki.apache.org/confluence/display/solr/Working+with+Dates

which specifies that the date format in Solr is as -MM-DDThh:mm:ssZ
I was wondering if

1) Solr support other date formats?
2) Solr supports other calendars such as Hijri calendar?

Regards,
Salman


Re: Solr Date Format

2015-11-25 Thread Alexandre Rafalovitch
Solr internally only supports that format. However, it is possible to
use an UpdateRequestProcessor to pre-process other formats. That's
what happening when you are using the "schemaless" mode:
https://github.com/apache/lucene-solr/blob/lucene_solr_5_3_1/solr/example/files/conf/solrconfig.xml#L1356

You don't need to use the whole schemaless mode, you can just add the
individual URP in a chain to your own handler. You can find the full
list of URPs at:
http://www.solr-start.com/info/update-request-processors/ . As of a
week ago, I added cross-links from the definitions to the mentions, so
jumping around should be even easier now.

Regarding Hiriji, it is a little more complicated. Joda time, which is
what  ParseDateFieldUpdateProcessorFactory uses does support hijiri ,
but it does not seem to be exposed through the URP. But it is probably
not too hard to clone the URP to your custom implementation and just
force it to the IslamicChronology:
http://joda-time.sourceforge.net/apidocs/index.html?org/joda/time/format/package-summary.html

Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 25 November 2015 at 06:56, Salman Ansari  wrote:
> Hi,
>
> I was exploring Solr date formats and came across the following link
> https://cwiki.apache.org/confluence/display/solr/Working+with+Dates
>
> which specifies that the date format in Solr is as -MM-DDThh:mm:ssZ
> I was wondering if
>
> 1) Solr support other date formats?
> 2) Solr supports other calendars such as Hijri calendar?
>
> Regards,
> Salman