August 13, 2011 | In: MySQL, Solr

Solr DataImportHandler Converts TINYINT to Boolean

When using Solr DataImportHandler with MySQL, the JDBC connection treats TINYINT(1) columns as BOOLEAN even if you have other values greater than. Most likely with a properly defined field of int type on your schema.xml you will get an error while indexing:

SEVERE: java.lang.NumberFormatException: For input string: “true”

This is a default behavior of Connector/J on the property tinyInt1isBit documented here. To fix this you should add tinyInt1isBit=false to your JDBC connection string.

1 Response to Solr DataImportHandler Converts TINYINT to Boolean

Avatar

zx9

December 12th, 2011 at 2:13 AM

OMG!! , this, break my head 4 hours!! , THANKS MAN!!.
in my frist stage, i change MySql tinyint(1) to tinyint(2) to solve.
But now!! ahahahahahaha ..
THANKS!!!!!!

Comment Form