lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Andersson <dan...@polkabrothers.com>
Subject Re: Unparseable date
Date Wed, 05 Mar 2008 21:48:09 GMT
It's stored in MySQL (datatype: datetime), then extracted and run  
through the following code:
$date = substr($date, 0, 10) . "T" . substr($date, 11) . "Z";

If there was some odd chars at the end, I would have assumed it would  
have been included in the error message.

SEVERE: java.lang.RuntimeException: java.text.ParseException:  
Unparseable date: "2008-02-12T15:02:06Z"
         at org.apache.solr.schema.DateField.toObject(DateField.java: 
173)

Seems to imply that that's all it's getting..

Cheers,
Daniel

On Mar 5, 2008, at 5:40 PM, Ryan Grange wrote:

> Solr does use 24 hour dates.  Are you positive there are no  
> extraneous characters at the end of your date string such as  
> carriage returns, spaces, or tabs?  I have the same format in the  
> code I've written and have never had a date parsing problem (yet).
>
> Ryan Grange, IT Manager
> DollarDays International, LLC
> rgrange@dollardays.com
> 480-922-8155 x106
>
>
>
> Daniel Andersson wrote:
>> Hi people
>>
>> I've got a date(&time] indexed with every document, defined as:
>> <field name="datetime_found" type="date" indexed="true"  
>> multiValued="false" />
>>
>> According to the schema.xml-file "The format for this date field  
>> is of the form 1995-12-31T23:59:59Z".
>>
>> Yet I'm getting the following error on SOME queries:
>>
>> Mar 5, 2008 10:32:53 AM org.apache.solr.common.SolrException log
>> SEVERE: java.lang.RuntimeException: java.text.ParseException:  
>> Unparseable date: "2008-02-12T15:02:06Z"
>>         at org.apache.solr.schema.DateField.toObject 
>> (DateField.java:173)
>>         at org.apache.solr.schema.DateField.toObject 
>> (DateField.java:83)
>>         at org.apache.solr.update.DocumentBuilder.loadStoredFields 
>> (DocumentBuilder.java:285)
>>         at  
>> com.pjaol.search.solr.component.LocalSolrQueryComponent.luceneDocToSo 
>> lrDoc(LocalSolrQueryComponent.java:403)
>>         at  
>> com.pjaol.search.solr.component.LocalSolrQueryComponent.mergeResultsD 
>> istances(LocalSolrQueryComponent.java:363)
>>         at  
>> com.pjaol.search.solr.component.LocalSolrQueryComponent.process 
>> (LocalSolrQueryComponent.java:305)
>>         at  
>> org.apache.solr.handler.component.SearchHandler.handleRequestBody 
>> (SearchHandler.java:158)
>>         at org.apache.solr.handler.RequestHandlerBase.handleRequest 
>> (RequestHandlerBase.java:118)
>>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:944)
>>         at org.apache.solr.servlet.SolrDispatchFilter.execute 
>> (SolrDispatchFilter.java:326)
>>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter 
>> (SolrDispatchFilter.java:278)
>>         at org.mortbay.jetty.servlet.ServletHandler 
>> $CachedChain.doFilter(ServletHandler.java:1089)
>>         at org.mortbay.jetty.servlet.ServletHandler.handle 
>> (ServletHandler.java:365)
>>         at org.mortbay.jetty.security.SecurityHandler.handle 
>> (SecurityHandler.java:216)
>>         at org.mortbay.jetty.servlet.SessionHandler.handle 
>> (SessionHandler.java:181)
>>         at org.mortbay.jetty.handler.ContextHandler.handle 
>> (ContextHandler.java:712)
>>         at org.mortbay.jetty.webapp.WebAppContext.handle 
>> (WebAppContext.java:405)
>>         at  
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle 
>> (ContextHandlerCollection.java:211)
>>         at org.mortbay.jetty.handler.HandlerCollection.handle 
>> (HandlerCollection.java:114)
>>         at org.mortbay.jetty.handler.HandlerWrapper.handle 
>> (HandlerWrapper.java:139)
>>         at org.mortbay.jetty.Server.handle(Server.java:285)
>>         at org.mortbay.jetty.HttpConnection.handleRequest 
>> (HttpConnection.java:502)
>>         at org.mortbay.jetty.HttpConnection 
>> $RequestHandler.headerComplete(HttpConnection.java:821)
>>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java: 
>> 513)
>>         at org.mortbay.jetty.HttpParser.parseAvailable 
>> (HttpParser.java:208)
>>         at org.mortbay.jetty.HttpConnection.handle 
>> (HttpConnection.java:378)
>>         at org.mortbay.jetty.bio.SocketConnector$Connection.run 
>> (SocketConnector.java:226)
>>         at org.mortbay.thread.BoundedThreadPool$PoolThread.run 
>> (BoundedThreadPool.java:442)
>> Caused by: java.text.ParseException: Unparseable date:  
>> "2008-02-12T15:02:06Z"
>>         at java.text.DateFormat.parse(DateFormat.java:335)
>>         at org.apache.solr.schema.DateField.toObject 
>> (DateField.java:170)
>>         ... 27 more
>>
>> Could this be because we're using 24h instead of 12h? (the example  
>> seems to imply that 24h is what should be used though)
>>
>> Thanks in advance!
>>
>> Kind regards,
>> Daniel
>>
>>

Mime
View raw message