Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @author Antoine Hedgecock <antoine@pmg.se>
- */
- /**
- * @namespace
- */
- namespace MCNCore\Sphinx;
- use SphinxClient,
- MCNCore\Object\QueryInfo,
- MCNCore\Pagination\Pagination;
- /**
- * @category
- */
- trait SearchTrait
- {
- /**
- * @var SphinxClient
- */
- protected $client;
- /**
- * @param Sphinx $sphinx
- */
- public function setSphinxClient(SphinxClient $sphinx)
- {
- $this->client = $sphinx;
- $this->client->setLimits(0, 6, 1000);
- var_dump($this->client->query('@topic hello', 'article'));
- var_dump($this->client->getLastWarning());
- var_dump($this->client->getLastError());
- exit;
- }
- protected function doSphinxSearch($index, $qi)
- {
- if (is_array($qi) || $qi instanceof \Traversable) {
- $qi = new QueryInfo($qi);
- }
- $this->processParameters(
- $qi->getParameters()
- );
- }
- private function processParameters(array $parameters)
- {
- }
- /**
- * @abstract
- * @return mixed
- */
- abstract protected function getRepository();
- }
Add Comment
Please, Sign In to add comment