SphinxQL Data too long for column

575 views Asked by At

I'm inserting data into a Sphinx RT index using SphinxQL, which is working fine. Just occasionally I get really large values in my dataset and I get the following error:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'title' at row 1
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3564)

Is there a way to extend the length of the field? or another column type I could use? Failing that, what is the length of the field, so I can truncate my data?

this is what my index looks like:

index example
{
      type              = rt
      path              = /var/sphinxsearch/example
      rt_field          = title
      rt_attr_timestamp = timestamp
}
1

There are 1 answers

0
djf On

I put my above comment into an Answer:

What version of MySQL are you using? What version of Sphinx? Maybe you're facing a Unicode encoding issue similiar to this one?

Maybe you could catch the Exception, log the offending SQL query. Perhaps the problem becomes apparent once you see the query.