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 rhys J <rh...@gmail.com> on 2020/01/14 15:24:03 UTC

Trouble adding a csv file - invalid date string error

I am trying to add a csv file while indexing a core.

curl command:

sudo -u solr curl '
http://localhost:8983/solr/dbtraddr/update/csv?commit=true&escape=\&encapsulator=%7C&stream.file=/tmp/csv/dbtrphon_0.csv
'


The header of the csv file:

|id|,|archive|,|contact_type|,|debtor_id|,|descr|,|group_id|,|item_no|,|phone|,|phone_index|,|source|,|source_id|,|status|,|time_stamp|,|type|,|user_id_stamp|


The line that the error is reported on:

|0-1|,|1|,| |,|0|,|Crystal Kolakowski|,|0|,|1|,|
crystal.kolakowski@yellowbook.com|,||,|LEH|,||,|A|,|2010-03-04
09:52:00|,|Email|,|LEH|

managed-schema lines defining the phone field:

<field name="phone" type="text_general" indexed="true" stored="true"
required="true" multiValued="false" />

managed-schema line defining date field:

<fieldType name="rdate" class="solr.DateRangeField" docValues="false"/>

The error:

"msg":"ERROR: [doc=0-1] Error adding field 'phone'='
crystal.kolakowski@yellowbook.com' msg=Invalid Date
String:'crystal.kolakowski@yellowbook.com'",
    "code":400}}

I am confused because the field it's reporting the error on is not a date
field.

I'm also confused because the rdate field was suggested to me by someone
here, and has worked in all the other indexing operations I've used on
other cores.

Am I missing something key here?

Thanks,

Rhys

Re: Trouble adding a csv file - invalid date string error

Posted by rhys J <rh...@gmail.com>.
I went ahead and adjusted the time_stamp field to be UTC, and that took
care of the problem.

On Tue, Jan 14, 2020 at 10:24 AM rhys J <rh...@gmail.com> wrote:

> I am trying to add a csv file while indexing a core.
>
> curl command:
>
> sudo -u solr curl '
> http://localhost:8983/solr/dbtraddr/update/csv?commit=true&escape=\&encapsulator=%7C&stream.file=/tmp/csv/dbtrphon_0.csv
> <http://localhost:8983/solr/dbtraddr/update/csv?commit=true&escape=%5C&encapsulator=%7C&stream.file=/tmp/csv/dbtrphon_0.csv>
> '
>
>
> The header of the csv file:
>
> |id|,|archive|,|contact_type|,|debtor_id|,|descr|,|group_id|,|item_no|,|phone|,|phone_index|,|source|,|source_id|,|status|,|time_stamp|,|type|,|user_id_stamp|
>
>
> The line that the error is reported on:
>
> |0-1|,|1|,| |,|0|,|Crystal Kolakowski|,|0|,|1|,|
> crystal.kolakowski@yellowbook.com|,||,|LEH|,||,|A|,|2010-03-04
> 09:52:00|,|Email|,|LEH|
>
> managed-schema lines defining the phone field:
>
> <field name="phone" type="text_general" indexed="true" stored="true"
> required="true" multiValued="false" />
>
> managed-schema line defining date field:
>
> <fieldType name="rdate" class="solr.DateRangeField" docValues="false"/>
>
> The error:
>
> "msg":"ERROR: [doc=0-1] Error adding field 'phone'='
> crystal.kolakowski@yellowbook.com' msg=Invalid Date
> String:'crystal.kolakowski@yellowbook.com'",
>     "code":400}}
>
> I am confused because the field it's reporting the error on is not a date
> field.
>
> I'm also confused because the rdate field was suggested to me by someone
> here, and has worked in all the other indexing operations I've used on
> other cores.
>
> Am I missing something key here?
>
> Thanks,
>
> Rhys
>