Good afternoon, I use SphinxQL after the Java API and encounter some troubles.

Request for grouping various options for products.

SELECT option, COUNT(*) FROM books WHERE MATCH('" + key + "') GROUP BY option; 

Result:

 option: 20,62, count: 34666 option: 20,62, count: 8309 option: 28, count: 313 

The API returned and this is cool. How to achieve the same result?

 option: 62, count: 34666 option: 20, count: 8309 option: 28, count: 313 

For the first example does not allow the use of aids options.

    1 answer 1

    @Groupby is required and everything will be as needed.

     SELECT @groupby AS shop..