Answer the question
In order to leave comments, you need to log in
How to get the value of the attribute specified in the select parameter in SphinxQL?
There is a query that searches for all groups of products that satisfy the search query
select
*
from
SearchCatalog
where
SearchCatalog.`query` = 'рюшь рюшь*;groupby=attr:rubric_id;select=*, @count as items_count_all;limit=100'
Answer the question
In order to leave comments, you need to log in
I'll add a little.
via Sphinx php API this is done like this (sphinx version - 2.0.8 - linux):
$sphinx_obj->SetGroupBy("rubric_id", SPH_GROUPBY_ATTR, "@count desc");
$sphinx_obj->SetLimits(0, 100, 100);
$sphinx_obj->SetSelect('rubric_id, @count as items_count');
$search_res = $sphinx_obj->Query($query, 'catalog_index');
[6345248] => Array
(
[weight] => 1
[attrs] => Array
(
[rubric_id] => 3763337
[@count] => 5
)
)
[3465352] => Array
(
[weight] => 1
[attrs] => Array
(
[rubric_id] => 3756960
[@count] => 2
)
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question