You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Roy Liu <li...@gmail.com> on 2011/04/07 11:01:56 UTC

How to index MS SQL Server column with image type

Hi all,

When I index a column(image type) of a table  via *
http://localhost:8080/solr/dataimport?command=full-import*
*There is a error like this: String length must be a multiple of four.*

Any help?
Thank you very much.

PS. the attachment includes Chinese character.

------------------------------------------------------------
*1. data-config.xml*
<dataConfig>
 <dataSource type="JdbcDataSource"
             driver="net.sourceforge.jtds.jdbc.Driver"
             url="jdbc:jtds:sqlserver://host:1433/db"
             user="username"
             password="password"/>

 <document>
   <entity name="doc"
           query="select id,*attachment*,filename as title from attachment
where ext='doc' and id>10000">
*           <field column="attachment" name="bs_attachment"/>*
   </entity>
 </document>
</dataConfig>

*2. schema.xml*
<field name="bs_attachment" type="binary" indexed="true" stored="true"/>

*3. Database*
*attachment *is a column of table attachment. it's type is IMAGE.


Best Regards,
Roy Liu

Re: How to index MS SQL Server column with image type

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: How to index MS SQL Server column with image type
: 
: Hi all,
: 
: When I index a column(image type) of a table  via *
: http://localhost:8080/solr/dataimport?command=full-import*
: *There is a error like this: String length must be a multiple of four.*

For future refrence: full error message (with stack traces) are the best 
way to get people to help you diagnose problems.

I think the crux of hte issue is that DataImportHandler doesn't 
currently have any way of indexing raw binary data like images.

Under teh covers, Solr can deal with pure binary fields, but there aren't 
a lot of good usecases i can think of for it -- particularly if you want 
to *index* those bytes...

: <field name="bs_attachment" type="binary" indexed="true" stored="true"/>

...can you please explain what your goal is?  what are you ultimatley 
hoping to do with that field?





-Hoss