Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: Architecte on Apr 19th, 2011  |  syntax: PHP  |  size: 0.44 KB  |  views: 113  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);
clone this paste RAW Paste Data