tpwd / ke_search

Search Extension for TYPO3 Content Management System, including faceting search functions.
https://extensions.typo3.org/extension/ke_search/
GNU General Public License v3.0
8 stars 31 forks source link

IndexerRunner SQL-Syntax for Database-Cluster #222

Closed rentz-skygate closed 5 months ago

rentz-skygate commented 6 months ago

I really like your extension. We are using a Percona-Database-Cluster and when running the instances in strict-mode (which should be used), the indexer cannot write into the database. As a quick solution i xclassed and wrapped the parts in the following code:

class IndexerRunner extends \Tpwd\KeSearch\Indexer\IndexerRunner
{
    public function insertRecordIntoIndex($fieldValues)
    {
        Db::getDatabaseConnection('tx_kesearch_index')->exec('BEGIN;');
        parent::insertRecordIntoIndex($fieldValues);
        Db::getDatabaseConnection('tx_kesearch_index')->exec('COMMIT;');
    }
    public function updateRecordInIndex($fieldValues)
    {
        Db::getDatabaseConnection('tx_kesearch_index')->exec('BEGIN;');
        parent::updateRecordInIndex($fieldValues);
        Db::getDatabaseConnection('tx_kesearch_index')->exec('COMMIT;');
    }

}

May be you can update your version to work properly with that setup.

Thank You.

christianbltr commented 6 months ago

Could you try https://github.com/tpwd/ke_search/tree/task/issue-222-statement-for-cluster if it works for you?

In "standard" installations the additional statements don't seem to harm. But I don't have the possibility to test it in an environment using a database cluster.

rentz-skygate commented 5 months ago

@christianbltr : Yes, it works, can you merge that please into a release ?!

christianbltr commented 5 months ago

This has been merged to master in will be in the next version after 5.4.1.