in per-letter mode, don't separate a and A

This commit is contained in:
Shish 2012-01-01 16:54:44 +00:00
parent c39697a40f
commit 56a780bfd3
2 changed files with 6 additions and 3 deletions

View File

@ -75,6 +75,7 @@ class MySQL extends DBEngine {
$data = str_replace("SCORE_DATETIME", "DATETIME", $data);
$data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data);
$data = str_replace("SCORE_STRNORM", "", $data);
$data = str_replace("SCORE_ILIKE", "LIKE", $data);
return $data;
}
@ -96,6 +97,7 @@ class PostgreSQL extends DBEngine {
$data = str_replace("SCORE_DATETIME", "TIMESTAMP", $data);
$data = str_replace("SCORE_NOW", "current_time", $data);
$data = str_replace("SCORE_STRNORM", "lower", $data);
$data = str_replace("SCORE_ILIKE", "ILIKE", $data);
return $data;
}
@ -142,6 +144,7 @@ class SQLite extends DBEngine {
$data = str_replace("SCORE_BOOL", "CHAR(1)", $data);
$data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data);
$data = str_replace("SCORE_STRNORM", "", $data);
$data = str_replace("SCORE_ILIKE", "LIKE", $data);
$cols = array();
$extras = "";
foreach(explode(",", $data) as $bit) {

View File

@ -141,7 +141,7 @@ class TagList implements Extension {
$tag_data = $database->get_col("
SELECT DISTINCT
substr(tag, 1, 1)
SCORE_STRNORM(substr(tag, 1, 1))
FROM tags
WHERE count >= :tags_min
ORDER BY tag
@ -183,7 +183,7 @@ class TagList implements Extension {
FLOOR(LOG(2.7, LOG(2.7, count - :tags_min + 1)+1)*1.5*100)/100 AS scaled
FROM tags
WHERE count >= :tags_min
AND tag LIKE :starts_with
AND tag SCORE_ILIKE :starts_with
ORDER BY tag
", array("tags_min"=>$tags_min, "starts_with"=>$starts_with));
@ -215,7 +215,7 @@ class TagList implements Extension {
SELECT tag, count
FROM tags
WHERE count >= :tags_min
AND tag LIKE :starts_with
AND tag SCORE_ILIKE :starts_with
ORDER BY tag
", array("tags_min"=>$tags_min, "starts_with"=>$starts_with));