SHARE
TWEET

Untitled

Architecte Apr 19th, 2011 115 Never
  1. $sphinx = new SphinxClient();
  2. $host = "localhost";
  3. $port = 9312;
  4. $index = "recipes";
  5. $type = $_GET['type'];
  6. $limit = $_GET['limit'];
  7. $offset = $_GET['offset'];
  8. $ranker = SPH_RANK_PROXIMITY_BM25;
  9. $mode = SPH_MATCH_ALL;
  10. $sphinx->_limit = $limit;
  11. $sphinx->_offset = $offset;
  12. $sphinx->SetServer($host, $port);
  13. $sphinx->SetConnectTimeout(0);
  14. $sphinx->SetMatchMode($mode);
  15. $sphinx->SetRankingMode($ranker);
  16. $res = $sphinx->Query($type, $index);
RAW Paste Data
Top