how to
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
how to
I have added 'ai-catsuggest' package to aimeos and I wanted to modify my existing keyword table (mshop_keyword) by adding a FULLTEXT index column so I wanted to create a Keywordindex.php file exactly like the SupplierIndex.php file located in vendor/aimeos/ai-catsuggest/setup/Supplierindex.php
help me on this
Thanks in advance
help me on this
Thanks in advance
Re: how to
Just copy the file to your ./setup directory and modify it:
Code: Select all
<?php
namespace Aimeos\Upscheme\Task;
class KeywordIndex extends Base
{
public function after() : array
{
return ['Product'];
}
public function up()
{
$db = $this->db( 'db-keyword' );
if( !$db->hasIndex( 'mshop_keyword', 'idx_mskey_label' ) )
{
$this->info( 'Creating keyword fulltext index', 'vv' );
$db->for( 'mysql', 'CREATE FULLTEXT INDEX `idx_mskey_label` ON `mshop_keyword` (`label`)' );
try {
$db->for( 'postgresql', 'CREATE INDEX "idx_mskey_label" ON "mshop_keyword" USING GIN (to_tsvector(\'english\', "label"))' );
} catch( \Exception $e ) {
// Doctrine DBAL bug: https://github.com/doctrine/dbal/issues/5351
}
}
}
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star