Esempio n. 1
0
 static function getSphinxIds(LsSphinxClient $s, $query = null)
 {
     $s->setSortMode(SPH_SORT_ATTR_DESC, 'created_at');
     $query = LsSphinxClient::cleanQuery($query);
     $result = $s->Query($query, 'notes notes_delta');
     if ($result === false) {
         throw new Exception("Sphinx search failed: " . $s->getLastError());
     }
     if ($result['total_found'] > 0 && isset($result['matches'])) {
         return array_keys($result['matches']);
     }
     return null;
 }