public function xmlReader2assoc($xml, $name) {
$tree = null;
while ($xml->read()) {
if ($xml->nodeType == XMLReader::END_ELEMENT) {
return $tree;
} else if ($xml->nodeType == XMLReader::ELEMENT) {
if ((!$xml->isEmptyElement)) {
$childs = $this->xmlReader2assoc($xml, $xml->localName);
if (count($childs) > 1) {
if (isset($tree[$xml->localName])) {
if (!isset($tree[$xml->localName][0])) {
$moved = $tree[$xml->localName];
unset($tree[$xml->localName]);
$tree[$xml->localName][0] = $moved;
}
$tree[$xml->localName][] = $childs;
} else {
$tree[$xml->localName] = $childs;
}
} else {
$tree[$xml->localName] = $childs;
}
}
} else if ($xml->nodeType == XMLReader::TEXT) {
$tree = $xml->value;
}
}
return $tree;
}
$cl->SetFilter(); //ставим все фильтры
$cl->AddQuery($base_word . $stop_word, 'index');
$cl->SetGroupBy ("status", SPH_GROUPBY_ATTR, "@count desc" );
$cl->AddQuery($base_word . $stop_word, 'index');
$cl->SetGroupBy ("cat", SPH_GROUPBY_ATTR, "@count desc" );
$cl->AddQuery($base_word . $stop_word, 'index');
$result = $cl->RunQueries();