Trouble adding a csv file - invalid date string error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble adding a csv file - invalid date string error

rhys J
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|,|
[hidden email]|,||,|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'='
[hidden email]' msg=Invalid Date
String:'[hidden email]'",
    "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
Reply | Threaded
Open this post in threaded view
|

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

rhys J
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 <[hidden email]> 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|,|
> [hidden email]|,||,|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'='
> [hidden email]' msg=Invalid Date
> String:'[hidden email]'",
>     "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
>