Campustream 1.0
A social network MQP for WPI
core/lib/sphinxmanager.php
Go to the documentation of this file.
00001 <?
00002 include_once 'Sphinx/SphinxClient.php';
00003 
00004 class SphinxManager {
00005         private static $connection;
00006         
00007         public static function connection() {
00008                 if (self::$connection == null) {        
00009                 self::$connection = new SphinxClient();
00010                 self::$connection->SetServer('10.179.65.133', 9312);
00011                 self::$connection->SetConnectTimeout(1);
00012                 self::$connection->SetArrayResult(true);
00013                 //self::$connection->SetFieldWeights(array('message'=>100));
00014                 //self::$connection->SetMatchMode(SPH_MATCH_EXTENDED);
00015                 self::$connection->SetRankingMode(SPH_RANK_PROXIMITY_BM25);
00016                 }
00017                 
00018                 return self::$connection;
00019         }
00020 }