Merge branch 'feature/sphinx_api' into develop

This commit is contained in:
Exile 2014-08-02 01:00:30 +04:00
commit b894f7f77f
2 changed files with 1857 additions and 1659 deletions

View file

@ -2510,14 +2510,11 @@ function init_sphinx ()
if (!isset($sphinx))
{
require(INC_DIR .'sphinxapi.php');
require(INC_DIR .'api.sphinx.php');
$sphinx = new SphinxClient();
$sphinx->SetConnectTimeout(5);
# $sphinx->SetMaxQueryTime(2);
$sphinx->SetRankingMode(SPH_RANK_NONE);
$sphinx->SetMatchMode(SPH_MATCH_BOOLEAN);
# $sphinx->SetSortMode($mode, $sortby="");
}
}
@ -2553,10 +2550,6 @@ function get_title_match_topics ($title_match_sql, $forum_ids = array())
{
$sphinx->SetFilter('forum_id', $forum_ids, false);
}
if (preg_match('#^"[^"]+"$#u', $title_match_sql))
{
$sphinx->SetMatchMode(SPH_MATCH_PHRASE);
}
if ($result = $sphinx->Query($title_match_sql, $where, $userdata['username'] .' ('. CLIENT_IP .')'))
{
if (!empty($result['matches']))