| @@ 127-131 (lines=5) @@ | ||
| 124 | */ |
|
| 125 | public function create_fulltext_index($field = 'topic_title') |
|
| 126 | { |
|
| 127 | if (!$this->is_index($field)) |
|
| 128 | { |
|
| 129 | $sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ADD FULLTEXT (' . $field . ')'; |
|
| 130 | $this->db->sql_query($sql); |
|
| 131 | } |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| @@ 65-69 (lines=5) @@ | ||
| 62 | $driver = $this->get_driver(); |
|
| 63 | ||
| 64 | // FULLTEXT is supported and topic_title IS NOT an index |
|
| 65 | if ($driver->is_supported() && !$driver->is_index('topic_title')) |
|
| 66 | { |
|
| 67 | $sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ADD FULLTEXT (topic_title)'; |
|
| 68 | $this->db->sql_query($sql); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| @@ 80-84 (lines=5) @@ | ||
| 77 | $driver = $this->get_driver(); |
|
| 78 | ||
| 79 | // FULLTEXT is supported and topic_title IS an index |
|
| 80 | if ($driver->is_supported() && $driver->is_index('topic_title')) |
|
| 81 | { |
|
| 82 | $sql = 'ALTER TABLE ' . TOPICS_TABLE . ' DROP INDEX topic_title'; |
|
| 83 | $this->db->sql_query($sql); |
|
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| @@ 51-55 (lines=5) @@ | ||
| 48 | $driver = new \vse\similartopics\driver\mysqli($this->db); |
|
| 49 | ||
| 50 | // Drop the FULLTEXT index |
|
| 51 | if ($driver->is_index('topic_title')) |
|
| 52 | { |
|
| 53 | $sql = 'ALTER TABLE ' . TOPICS_TABLE . ' DROP INDEX topic_title'; |
|
| 54 | $this->db->sql_query($sql); |
|
| 55 | } |
|
| 56 | ||
| 57 | // Revert the storage engine back to its original setting |
|
| 58 | $sql = 'ALTER TABLE ' . TOPICS_TABLE . ' ENGINE = ' . $this->db->sql_escape(strtoupper($this->config['similar_topics_fulltext'])); |
|