Answer the question
In order to leave comments, you need to log in
How to get the unique properties of products and the number of products with these properties from the sphinx?
Good afternoon!
There is a task "to receive from the Sphinx unique properties of the goods and an amount of the goods with these properties".
In other words, get an output similar to a SQL query from the Sphinx:
SELECT i.prop, count(i.prop) FROM table_items i GROUP BY i.prop
$cl->setGroupBy('tags', 4, '@groupby asc');
$result = $cl->query($query, $index);
foreach ($result['matches'] as $match)
{
var_dump($match['attrs']['@groupby'], $match['attrs']['tags']);
}
int 24
array (size=2)
0 => int 24
1 => int 273
int 58
array (size=2)
0 => int 58
1 => int 273
int 273
array (size=2)
0 => int 234
1 => int 273
Answer the question
In order to leave comments, you need to log in
max_matches is configured which one?
(see doc: WARNING: grouping is done in fixed memory and thus its results are only approximate; so there might be more groups reported in total_found than actually present. @count might also be underestimated. To reduce inaccuracy, one should raise max_matches .if max_matches allows to store all found groups, results will be 100% correct. )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question