mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Merge branch 'feature/sphinx_api' into develop
This commit is contained in:
commit
b894f7f77f
2 changed files with 1857 additions and 1659 deletions
File diff suppressed because it is too large
Load diff
|
@ -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']))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue