aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-12-27 00:06:39 +0000
committerNils Adermann <naderman@naderman.de>2006-12-27 00:06:39 +0000
commitb41365fcd41fc185fe197667d2f0bec13f6c30c2 (patch)
treee7746c0e1e870e82a62bb52f08cdb10977059d56 /phpBB/includes/search
parent677dc5d2e11c3209fcaf798e4b44588a9305328f (diff)
downloadforums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.gz
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.bz2
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.tar.xz
forums-b41365fcd41fc185fe197667d2f0bec13f6c30c2.zip
- display search type as page title for premade searches [Bug #6508]
- flash enabled on user side by default, so that admins can actually change anything by activating it (still disabled by default) - properly implemented password complexity check [Bug #6584] - do not ldap_escape paramaters for the bind function [Bug #6208] - deleted words in edited post subjects weren't getting there search cache refreshed [Bug #6288] - made common word threshold configurable [Bug #6168] - recreated word match table entries after installation, side effect of bug #6060 - option to only allow ASCII usernames - adjusted search page pagination [Bug #6424] - correctly calculate unformatted search result extract length git-svn-id: file:///svn/phpbb/trunk@6814 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search')
-rwxr-xr-xphpBB/includes/search/fulltext_native.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 4ad0f8ae41..cbdef03b88 100755
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -1136,7 +1136,7 @@ class fulltext_native extends search_backend
}
// destroy cached search results containing any of the words removed or added
- $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['post'])), array($poster_id));
+ $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id));
unset($unique_add_words);
unset($words);
@@ -1179,14 +1179,15 @@ class fulltext_native extends search_backend
$destroy_cache_words = array();
- // Remove common (> 20% of posts ) words
- if ($config['num_posts'] >= 100)
+ // Remove common words
+ if ($config['num_posts'] >= 100 && $config['fulltext_native_common_thres'])
{
+ $common_threshold = ((double) $config['fulltext_native_common_thres']) / 100.0;
// First, get the IDs of common words
$sql = 'SELECT word_id
FROM ' . SEARCH_WORDMATCH_TABLE . '
GROUP BY word_id
- HAVING COUNT(word_id) > ' . floor($config['num_posts'] * 0.2);
+ HAVING COUNT(word_id) > ' . floor($config['num_posts'] * $common_threshold);
$result = $db->sql_query($sql);
$sql_in = array();
@@ -1556,12 +1557,16 @@ class fulltext_native extends search_backend
<dt><label for="fulltext_native_max_chars">' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_native_max_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_max_chars]" value="' . (int) $config['fulltext_native_max_chars'] . '" /></dd>
</dl>
+ <dl>
+ <dt><label for="fulltext_native_common_thres">' . $user->lang['COMMON_WORD_THRESHOLD'] . ':</label><br /><span>' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (int) $config['fulltext_native_common_thres'] . '" /> %</dd>
+ </dl>
';
// These are fields required in the config table
return array(
'tpl' => $tpl,
- 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255')
+ 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100')
);
}
}