On 12/11/2013 3:09 AM, ravi1984 wrote: > Thanks much for the reply! We have this working through Java layer and > facing the issues when integrated with SOLR layer. > > We tried to tweak the Query itself to return the String - following are the > options we tried, and still there was no luck. Do we need to tweak anything > in the Schema.xml, with regard to the field: cust_data? > > select XMLSERIALIZE(DTL_XML as CLOB(1M)) as DTL_XML from testSch.SUMMRY_DTL > where DTL_XML IS NOT NULL FETCH FIRST 50 ROWS ONLY > > Select XMLCAST(DTL_XML AS CLOB(1M)) as DTL_XML from testSch.SUMMRY_DTL where > DTL_XML IS NOT NULL FETCH FIRST 50 ROWS ONLY
Upgrading the JDBC driver and talking to IBM are your best options to try first. In a newer driver version, IBM might have implemented a toString() method on the XML object type. I have no idea whether this is the case or not -- I'm completely unfamiliar with DB2. You could try returning the XML column as a CLOB and then using the ClobTransformer. Reading what I can find on XMLCAST, it seems as though this probably is returning as CLOB, which Solr is unable to deal with natively -- requiring the transformer. http://wiki.apache.org/solr/DataImportHandler#ClobTransformer If those don't yield something useful, you might need to write some custom code. That might be a straight modification of DIH to use the IBM data types directly, or you might write a custom transformer or a custom update handler. Thanks, Shawn