Search/Fixup
* do not use stopwords in fulltext search apparentyl there is a bug in innodb where including stopwords in a search causes the lookup to fail entirely. e.g. innodb_ft_enable_stopword must be disabled when the index is edited (rows are added/removed) * don't create a MATCH AGAINST search from empty search strings after sanitization * drop fulltext indizes for locale zhCN logographic languages need special treatment, which handling may differ by db provider * use LIKE search by default for locale zhCN. Added config option to use fulltext if supported by db.
This commit is contained in:
parent
7616ec25fc
commit
6df9145446
14 changed files with 156 additions and 64 deletions
|
|
@ -581,7 +581,6 @@ CREATE TABLE `aowow_creature` (
|
|||
FULLTEXT `idx_name0` (`name_loc0`),
|
||||
FULLTEXT `idx_name2` (`name_loc2`),
|
||||
FULLTEXT `idx_name3` (`name_loc3`),
|
||||
FULLTEXT `idx_name4` (`name_loc4`),
|
||||
FULLTEXT `idx_name6` (`name_loc6`),
|
||||
FULLTEXT `idx_name8` (`name_loc8`),
|
||||
KEY `idx_spell1` (`spell1`),
|
||||
|
|
@ -1473,7 +1472,6 @@ CREATE TABLE `aowow_items` (
|
|||
FULLTEXT `idx_name0` (`name_loc0`),
|
||||
FULLTEXT `idx_name2` (`name_loc2`),
|
||||
FULLTEXT `idx_name3` (`name_loc3`),
|
||||
FULLTEXT `idx_name4` (`name_loc4`),
|
||||
FULLTEXT `idx_name6` (`name_loc6`),
|
||||
FULLTEXT `idx_name8` (`name_loc8`),
|
||||
KEY `idx_itemset` (`itemset`)
|
||||
|
|
@ -1668,7 +1666,6 @@ CREATE TABLE `aowow_objects` (
|
|||
FULLTEXT `idx_name0` (`name_loc0`),
|
||||
FULLTEXT `idx_name2` (`name_loc2`),
|
||||
FULLTEXT `idx_name3` (`name_loc3`),
|
||||
FULLTEXT `idx_name4` (`name_loc4`),
|
||||
FULLTEXT `idx_name6` (`name_loc6`),
|
||||
FULLTEXT `idx_name8` (`name_loc8`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
|
@ -2272,7 +2269,6 @@ CREATE TABLE `aowow_quests` (
|
|||
FULLTEXT `idx_name0` (`name_loc0`),
|
||||
FULLTEXT `idx_name2` (`name_loc2`),
|
||||
FULLTEXT `idx_name3` (`name_loc3`),
|
||||
FULLTEXT `idx_name4` (`name_loc4`),
|
||||
FULLTEXT `idx_name6` (`name_loc6`),
|
||||
FULLTEXT `idx_name8` (`name_loc8`),
|
||||
KEY `idx_sourcespell` (`sourceSpellId`),
|
||||
|
|
@ -2881,7 +2877,6 @@ CREATE TABLE `aowow_spell` (
|
|||
FULLTEXT `idx_name0` (`name_loc0`),
|
||||
FULLTEXT `idx_name2` (`name_loc2`),
|
||||
FULLTEXT `idx_name3` (`name_loc3`),
|
||||
FULLTEXT `idx_name4` (`name_loc4`),
|
||||
FULLTEXT `idx_name6` (`name_loc6`),
|
||||
FULLTEXT `idx_name8` (`name_loc8`),
|
||||
KEY `idx_spellfamily` (`spellFamilyId`),
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
5
setup/sql/04-db_optional_mysql_only.sql
Normal file
5
setup/sql/04-db_optional_mysql_only.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE `aowow_creature` ADD FULLTEXT `idx_name4` (`name_loc4`) WITH PARSER ngram;
|
||||
ALTER TABLE `aowow_items` ADD FULLTEXT `idx_name4` (`name_loc4`) WITH PARSER ngram;
|
||||
ALTER TABLE `aowow_objects` ADD FULLTEXT `idx_name4` (`name_loc4`) WITH PARSER ngram;
|
||||
ALTER TABLE `aowow_quests` ADD FULLTEXT `idx_name4` (`name_loc4`) WITH PARSER ngram;
|
||||
ALTER TABLE `aowow_spell` ADD FULLTEXT `idx_name4` (`name_loc4`) WITH PARSER ngram;
|
||||
16
setup/sql/updates/1768672799_01.sql
Normal file
16
setup/sql/updates/1768672799_01.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
ALTER TABLE `aowow_creature` DROP INDEX `idx_name4`;
|
||||
ALTER TABLE `aowow_items` DROP INDEX `idx_name4`;
|
||||
ALTER TABLE `aowow_objects` DROP INDEX `idx_name4`;
|
||||
ALTER TABLE `aowow_quests` DROP INDEX `idx_name4`;
|
||||
ALTER TABLE `aowow_spell` DROP INDEX `idx_name4`;
|
||||
|
||||
SET SESSION innodb_ft_enable_stopword = OFF;
|
||||
|
||||
OPTIMIZE TABLE `aowow_spell`;
|
||||
OPTIMIZE TABLE `aowow_quests`;
|
||||
OPTIMIZE TABLE `aowow_creature`;
|
||||
OPTIMIZE TABLE `aowow_items`;
|
||||
OPTIMIZE TABLE `aowow_objects`;
|
||||
|
||||
REPLACE INTO `aowow_config` VALUES
|
||||
('logographic_ft_search', '0', '0', 1, 0x484, 'enables fulltext search for logographic languages (CN, KR, TW). The database MUST support this (i.e. MySQL implements ngram)');
|
||||
|
|
@ -102,8 +102,10 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||
{ WHERE ct.entry IN (?a) }
|
||||
LIMIT ?d, ?d';
|
||||
|
||||
$i = 0;
|
||||
DB::Aowow()->query('TRUNCATE ?_creature');
|
||||
DB::Aowow()->query('SET SESSION innodb_ft_enable_stopword = OFF');
|
||||
|
||||
$i = 0;
|
||||
while ($npcs = DB::World()->select($baseQuery, NPC_CU_INSTANCE_BOSS, $ids ?: DBSIMPLE_SKIP, CLISetup::SQL_BATCH * $i, CLISetup::SQL_BATCH))
|
||||
{
|
||||
CLI::write(' * batch #' . ++$i . ' (' . count($npcs) . ')', CLI::LOG_BLANK, true, true);
|
||||
|
|
|
|||
|
|
@ -130,8 +130,10 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||
{ WHERE it.entry IN (?a) }
|
||||
LIMIT ?d, ?d';
|
||||
|
||||
$i = 0;
|
||||
DB::Aowow()->query('TRUNCATE ?_items');
|
||||
DB::Aowow()->query('SET SESSION innodb_ft_enable_stopword = OFF');
|
||||
|
||||
$i = 0;
|
||||
while ($items = DB::World()->select($baseQuery, $ids ?: DBSIMPLE_SKIP, CLISetup::SQL_BATCH * $i, CLISetup::SQL_BATCH))
|
||||
{
|
||||
CLI::write(' * batch #' . ++$i . ' (' . count($items) . ')', CLI::LOG_BLANK, true, true);
|
||||
|
|
|
|||
|
|
@ -67,8 +67,10 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||
GROUP BY go.entry
|
||||
LIMIT ?d, ?d';
|
||||
|
||||
$i = 0;
|
||||
DB::Aowow()->query('TRUNCATE ?_objects');
|
||||
DB::Aowow()->query('SET SESSION innodb_ft_enable_stopword = OFF');
|
||||
|
||||
$i = 0;
|
||||
while ($objects = DB::World()->select($baseQuery, $ids ?: DBSIMPLE_SKIP, CLISetup::SQL_BATCH * $i, CLISetup::SQL_BATCH))
|
||||
{
|
||||
CLI::write(' * batch #' . ++$i . ' (' . count($objects) . ')', CLI::LOG_BLANK, true, true);
|
||||
|
|
|
|||
|
|
@ -116,8 +116,10 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||
{ WHERE q.Id IN (?a) }
|
||||
LIMIT ?d, ?d';
|
||||
|
||||
$i = 0;
|
||||
DB::Aowow()->query('TRUNCATE ?_quests');
|
||||
DB::Aowow()->query('SET SESSION innodb_ft_enable_stopword = OFF');
|
||||
|
||||
$i = 0;
|
||||
while ($quests = DB::World()->select($baseQuery, $ids ?: DBSIMPLE_SKIP, CLISetup::SQL_BATCH * $i, CLISetup::SQL_BATCH))
|
||||
{
|
||||
CLI::write(' * batch #' . ++$i . ' (' . count($quests) . ')', CLI::LOG_BLANK, true, true);
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||
|
||||
|
||||
DB::Aowow()->query('TRUNCATE ?_spell');
|
||||
DB::Aowow()->query('SET SESSION innodb_ft_enable_stopword = OFF');
|
||||
|
||||
// merge serverside spells into aowow_spell
|
||||
$lastMax = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue