-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Separated record and text in full text search.
- Loading branch information
Daniel Berthereau
authored and
Daniel Berthereau
committed
Feb 19, 2024
1 parent
05dc50e
commit 6ec9e2a
Showing
13 changed files
with
154 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
application/data/migrations/20240219000004_SeparateRecordAndTextForFullText.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Omeka\Db\Migrations; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
use Omeka\Db\Migration\ConstructedMigrationInterface; | ||
use Omeka\Job\Dispatcher as JobDispatcher; | ||
|
||
class SeparateRecordAndTextForFullText implements ConstructedMigrationInterface | ||
{ | ||
/** | ||
* @var \Omeka\Job\Dispatcher | ||
*/ | ||
private $jobDispatcher; | ||
|
||
public function __construct(JobDispatcher $jobDispatcher) | ||
{ | ||
$this->jobDispatcher = $jobDispatcher; | ||
} | ||
|
||
public function up(Connection $conn) | ||
{ | ||
$sql = <<<'SQL' | ||
TRUNCATE TABLE `fulltext_search`; | ||
ALTER TABLE `fulltext_search` | ||
ADD `record` longtext COLLATE 'utf8mb4_unicode_ci' NULL AFTER `title`; | ||
ALTER TABLE `fulltext_search` | ||
ADD FULLTEXT `IDX_AA31FE4A2B36786B9B349F91` (`title`, `record`), | ||
ADD FULLTEXT `IDX_AA31FE4A3B8BA7C7` (`text`), | ||
DROP INDEX `IDX_AA31FE4A2B36786B3B8BA7C7`; | ||
|
||
SQL; | ||
$conn->executeStatement($sql); | ||
|
||
$this->jobDispatcher->dispatch(\DerivativeMedia\Job\DerivativeItem::class); | ||
} | ||
|
||
public static function create(ServiceLocatorInterface $services) | ||
{ | ||
return new self($services->get(\Omeka\Job\Dispatcher::class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters