From 160a451feda822ae52ec060093ca967eaa3f7647 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Tue, 25 Jan 2022 16:48:18 -0500 Subject: [PATCH 1/2] Lengths and orders not necessary for fulltext indexes --- app/config/collections.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index abcdec9c1d..daccd9258d 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -99,8 +99,8 @@ $collections = [ '$id' => '_fulltext_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [1024], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -574,8 +574,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1106,8 +1106,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], [ '$id' => '_key_deleted_email', @@ -1422,8 +1422,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1720,8 +1720,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1892,8 +1892,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -1983,8 +1983,8 @@ $collections = [ '$id' => '_key_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], @@ -2118,8 +2118,8 @@ $collections = [ '$id' => '_fulltext_search', 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [16384], - 'orders' => [Database::ORDER_ASC], + 'lengths' => [], + 'orders' => [], ], ], ], From 732e4c0b20312681344f7ae993f521e1eb5cdb15 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Wed, 26 Jan 2022 11:01:49 -0500 Subject: [PATCH 2/2] Add missing port to PDO dsn for workers --- app/init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index d591d1ddbd..a45ac69aea 100644 --- a/app/init.php +++ b/app/init.php @@ -491,11 +491,12 @@ $register->set('geodb', function () { }); $register->set('db', function () { // This is usually for our workers or CLI commands scope $dbHost = App::getEnv('_APP_DB_HOST', ''); + $dbPort = App::getEnv('_APP_DB_PORT', ''); $dbUser = App::getEnv('_APP_DB_USER', ''); $dbPass = App::getEnv('_APP_DB_PASS', ''); $dbScheme = App::getEnv('_APP_DB_SCHEMA', ''); - $pdo = new PDO("mysql:host={$dbHost};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( + $pdo = new PDO("mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', PDO::ATTR_TIMEOUT => 3, // Seconds PDO::ATTR_PERSISTENT => true,