pat / riddle

Ruby Client API for Sphinx
MIT License
135 stars 67 forks source link

using group_concat in select causes exception #97

Closed kapcod closed 8 years ago

kapcod commented 8 years ago

Starting with 2.1.1-beta we can use group_concat in select together with group by, however when using it API returns attribute type 10, which is not handled and it raises exception. When I tried to add handling to 10 => :next, it returned empty string, same as other string attributes.

pat commented 8 years ago

I presume this issue is when you're using the binary protocol (via Riddle), rather than SphinxQL (via mysql2)? I've just had a glance at the PHP API provided by the Sphinx team, and there's no attribute type 10 there: https://github.com/sphinxsearch/sphinx/blob/master/api/sphinxapi.php#L94

I'm wondering if these newer features are only supported via SphinxQL? Is it possible for you to use that instead? You can find some code that may be useful for this in Thinking Sphinx: https://github.com/pat/thinking-sphinx/blob/master/lib/thinking_sphinx/connection.rb#L99

kapcod commented 8 years ago

It's just too much refactoring to switch to ThinkingSphinx, we have tens of indexes defined with direct sphinx config, this index is the first where I need to use group concat. I think, though, if string attributes will start working, then maybe we'll be able to tweak this one too.