since a while Sphinx search can be queried not only by their own non-standard interface but also using regular mysql client. they call this feature SphinxQL.
so my work‘s backend no longer has to rely on my own failover code for sphinx – i can leave the dirty details to resin. appserv is already providing resiliency for communication with mysql servers.
but.. it turned out it was not enough to configure database driver pointing to a sphinx server. when i did it i was getting exceptions:
[08:56:11.466] Caused by: java.lang.IllegalArgumentException: Null charset name
[08:56:11.466] at java.nio.charset.Charset.lookup(Charset.java:429)
[08:56:11.466] at java.nio.charset.Charset.forName(Charset.java:502)
[08:56:11.466] at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1936)
so i added at the end of the connection string:
characterEncoding=utf8
but then i got this:
[09:15:58.498] appserv.ParalellEntitySearcher - problems occured com.mysql.jdbc.PacketTooBigException: Packet for query is too large (26 > -1). You can change this value on the server by setting the max_allowed_packet' variable.
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:612)
[09:15:58.498] at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:415)
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2576)
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1757)
so i added this at the end of the connection string:
maxAllowedPacket=512000
quite a generous number, probably 1/20th would do a trick too.
maybe someone will find this useful..
Please tell me more details with code or full connection string statement . i am stucked with PacketTooBigException. thanks in advance
for what version of sphinx? in 0.9.9 i’m using:
jdbc:mysql://10.11.12.13:9306/data?socketTimeout=20000&connectTimeout=2000&autoReconnectForPools=true&characterEncodingutf8&maxAllowedPacket=512000
also check http://sphinxsearch.com/bugs/view.php?id=1208 and http://sphinxsearch.com/forum/view.html?id=9324 – hopefully finally things will get better in 2.0.5