Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function querySphinx($string, $options)
- {
- $this->sphinx->SetSortMode(SPH_SORT_RELEVANCE);
- $this->sphinx->SetLimits(0, 500);
- $this->sphinx->SetMatchMode(SPH_MATCH_ALL);
- if ($options['system'] !== 'all')
- $this->sphinx->SetFilter('system', array($this->crc32($options['system'])));
- if ($options['region'] !== 'all')
- $this->sphinx->SetFilter('region', array(
- $this->crc32('(' . $options['region'] . ')'),
- $this->crc32('[' . $options['region'] . ']')
- ));
- $result = $this->sphinx->Query($string, 'romulation_files');
- if (!$result)
- die('Failed with error:' . $this->sphinx->GetLastError());
- if ( !isset($result['matches']) )
- return false;
- return join( ',', array_keys($result['matches']) );
- }
- ?>
Add Comment
Please, Sign In to add comment