You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/09/07 10:50:25 UTC

[Solr Wiki] Update of "DataImportHandlerFaq" by ShalinMangar

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ShalinMangar:
http://wiki.apache.org/solr/DataImportHandlerFaq

The comment on the change is:
Added note on using blob values

------------------------------------------------------------------------------
        user="" password=""/>
  }}}
  
+ === Blob values in my table are added to the Solr document as object strings like B@1f23c5 ===
+ The problem occurs because blobs are read as a byte array which does not have a useful toString method. The workaround is to:
+  1. Use convertType="true" on the !JdbcDataSource
+  1. Write a Transformer which converts the byte[] into a string type
+  1. You can also use a "cast" sql function which can convert the data type from blob to strings if your database provides such a function
+ 
+ Note that "convertType" attribute uses the target schema field's type name to convert the value returned by the result set. Therefore, any transformers being used on the entity should be aware of the type information.
+