Advertisement
Architecte

Untitled

Apr 19th, 2011
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement