lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Serba (JIRA)" <>
Subject [jira] Created: (SOLR-2102) JdbcDataSource convertType attribute is not working with implicit fields
Date Sun, 05 Sep 2010 22:43:32 GMT
JdbcDataSource convertType attribute is not working with implicit fields

                 Key: SOLR-2102
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 1.4.1
            Reporter: Alexey Serba

JdbcDataSource convertType attribute doesn't take any effect on implicit fields ( fields that
are not listed in [field declaration section|]

For example you might have the following configuration:

<?xml version="1.0" encoding="UTF-8"?>
  <dataSource batchSize="-1" convertType="true" driver="com.mysql.jdbc.Driver"
    password="pass" url="jdbc:mysql://localhost/test" user="root"/>
  <document name="items">
    <entity query="SELECT title, body, tm FROM articles order by title desc">

* tm is timestamp in mysql database
* tm is date in schema.xml

Because field _tm_ is not explicitly stated in fields declaration _convertType_ attribute
doesn't take any effect and as a result you would get the following exception:

{noformat:title=convertType exception}
Sep 6, 2010 2:22:09 AM org.apache.solr.handler.dataimport.SolrWriter upload
WARNING: Error creating document : SolrInputDocument[{body=body(1.0)={Apache Lucene is a free/open
source information retrieval software library, originally created in Java by Doug Cutting.},
tm=tm(1.0)={2010-09-06 02:06:25.0}, title=title(1.0)={Lucene}}]
org.apache.solr.common.SolrException: Error while creating field 'tm{type=date,default=NOW,properties=indexed,stored,omitNorms,sortMissingLast}'
from value '2010-09-06 02:06:25.0'
        at org.apache.solr.schema.FieldType.createField(
        at org.apache.solr.schema.SchemaField.createField(
        at org.apache.solr.update.DocumentBuilder.addField(
        at org.apache.solr.update.DocumentBuilder.toDocument(
        at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(
        at org.apache.solr.handler.dataimport.SolrWriter.upload(
        at org.apache.solr.handler.dataimport.DataImportHandler$1.upload(
        at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(
        at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(
        at org.apache.solr.handler.dataimport.DocBuilder.execute(
        at org.apache.solr.handler.dataimport.DataImporter.doFullImport(
        at org.apache.solr.handler.dataimport.DataImporter.runCmd(
        at org.apache.solr.handler.dataimport.DataImporter$
Caused by: org.apache.solr.common.SolrException: Invalid Date String:'2010-09-06 02:06:25.0'
        at org.apache.solr.schema.DateField.parseMath(
        at org.apache.solr.schema.DateField.toInternal(
        at org.apache.solr.schema.FieldType.createField(
        ... 12 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message