1. Go to this page and download the library: Download gemorroj/sphinx-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$itemsPerPage = 50;
$page = 1;
$client = $this->get('highco.sphinx.client');
$client->SetLimits( ($page -1) * $itemsPerPage, $itemsPerPage);
$bridge = $this->get('highco.sphinx.pager.white_october.doctrine_orm');
/**
* Make sure you have this column defined as attribute in Sphinx (i.e: sql_attr_string = type).
* Sphinx prior version 1.10 does not have support for sql_attr_string, but you can use sql_attr_uint
* and have your discriminators defined as constants in PHP.
*/
$bridge->setDiscriminatorColumn('type');
$bridge->setDiscriminatorRepositories(array(
'article' => array(
'class' => 'BlogBundle:Article',
'em' => 'default',
),
'category' => array(
'class' => 'BlogBundle:Category',
'em' => 'default',
),
'note' => array(
'class' => 'NotesBundle:Message',
'em' => 'notes'
),
));
$bridge->setPkColumn('id');
$bridge->setSphinxResults($client->Query('Stéphane'));
$pager = $bridge->getPager();
$pager->setMaxPerPage($itemsPerPage);
$pager->setCurrentPage($page);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.