protected function applyCriteria(ESphinxCriteria $criteria)
{
$this->applyMatchMode($criteria->matchMode);
$this->applyRankMode($criteria->rankMode);
$this->applySortMode($criteria->sortMode);
// apply select
if (strlen($criteria->select)) {
$this->sphinxClient->SetSelect($criteria->select);
}
// apply limit
if ($criteria->getIsLimited()) {
$this->sphinxClient->SetLimits($criteria->offset, $criteria->limit, $criteria->max_matches, $criteria->cutoff);
}
// apply group
if ($criteria->getIsGroupSetted()) {
$this->sphinxClient->SetGroupBy($criteria->getGroupBy(), $criteria->getGroupFunc());
}
// apply id range
if ($criteria->getIsIdRangeSetted()) {
$this->sphinxClient->SetIDRange($criteria->getIdMin(), $criteria->getIdMax());
}
// apply weights
$this->applyFieldWeights($criteria->getFieldWeights());
$this->applyIndexWeights($criteria->getIndexWeights());
// apply filters
$this->applyFilters($criteria->getInConditions());
$this->applyFilters($criteria->getNotInConditions(), true);
// apply ranges
$this->applyRanges($criteria->getInRanges());
$this->applyRanges($criteria->getNotInRanges(), true);
}