You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Peer Allan <Pe...@canadadrugs.com> on 2008/11/24 14:03:55 UTC
DateField Problem
Hello all,
I am trying to update a system that uses solr to use version 1.3, but have
stumbled across a problem I can¹t seem to fix. Solr is throwing errors on a
date and I don't know why. Here is the request XML:
<add>
<doc>
<field name="type_t">Movie</field>
<field name="pk_i">1</field>
<field name="id">Movie:1</field>
<field name="name_t" boost="1.0">Napoleon Dynamite</field>
<field name="description_t" boost="1.0">Cool movie about a goofy
guy</field>
<field name="time_on_xml_d" boost="1.0">2008-11-24T12:58:47Z</field>
</doc>
</add>
Posting this to solr gives me this error:
SEVERE: org.apache.solr.common.SolrException: Error while creating field
'time_on_xml_d{type=sdouble,properties=indexed,stored,omitNorms,sortMissingL
ast}' from value '2008-11-24T12:58:47Z'
I have read the release notes for 1.3 and realize there is improved
validation which is probably the source of the new error. I have read the
documentation on the DateField and from what I can tell it the date is in a
valid format. Can anyone tell me what's wrong here? Thanks.
Peer
Re: DateField Problem
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Nov 24, 2008, at 8:03 AM, Peer Allan wrote:
> I am trying to update a system that uses solr to use version 1.3,
> but have
> stumbled across a problem I can’t seem to fix. Solr is throwing
> errors on a
> date and I don't know why. Here is the request XML:
>
> <add>
> <doc>
> <field name="type_t">Movie</field>
> <field name="pk_i">1</field>
> <field name="id">Movie:1</field>
> <field name="name_t" boost="1.0">Napoleon Dynamite</field>
> <field name="description_t" boost="1.0">Cool movie about a goofy
> guy</field>
> <field name="time_on_xml_d" boost="1.0">2008-11-24T12:58:47Z</
> field>
> </doc>
> </add>
>
> Posting this to solr gives me this error:
>
> SEVERE: org.apache.solr.common.SolrException: Error while creating
> field
> 'time_on_xml_d
> {type=sdouble,properties=indexed,stored,omitNorms,sortMissingL
> ast}' from value '2008-11-24T12:58:47Z'
Note that it says "type=sdouble". You need to have that mapped to a
date field, not sdouble. I guess you're getting caught by the *_d
mapping from the example schema? Try time_on_xml_dt instead, if
you've got that mapped.
Erik