$sphinx = new SphinxClient();
$host = "localhost";
$port = 9312;
$index = "recipes";
$type = $_GET['type'];
$limit = $_GET['limit'];
$offset = $_GET['offset'];
$ranker = SPH_RANK_PROXIMITY_BM25;
$mode = SPH_MATCH_ALL;
$sphinx->_limit = $limit;
$sphinx->_offset = $offset;
$sphinx->SetServer($host, $port);
$sphinx->SetConnectTimeout(0);
$sphinx->SetMatchMode($mode);
$sphinx->SetRankingMode($ranker);
$res = $sphinx->Query($type, $index);