diff --git a/config/scout.php b/config/scout.php index d580fff2..39b9f5de 100644 --- a/config/scout.php +++ b/config/scout.php @@ -153,26 +153,28 @@ */ 'typesense' => [ - 'api_key' => env('TYPESENSE_API_KEY', 'xyz'), - 'nodes' => [ - [ + 'client_configuration' => [ + 'api_key' => env('TYPESENSE_API_KEY', 'xyz'), + 'nodes' => [ + [ + 'host' => env('TYPESENSE_HOST', 'localhost'), + 'port' => env('TYPESENSE_PORT', '8108'), + 'path' => env('TYPESENSE_PATH', ''), + 'protocol' => env('TYPESENSE_PROTOCOL', 'http'), + ], + ], + 'nearest_node' => [ 'host' => env('TYPESENSE_HOST', 'localhost'), 'port' => env('TYPESENSE_PORT', '8108'), 'path' => env('TYPESENSE_PATH', ''), 'protocol' => env('TYPESENSE_PROTOCOL', 'http'), ], + 'connection_timeout_seconds' => env('TYPESENSE_CONNECTION_TIMEOUT_SECONDS', 2), + 'healthcheck_interval_seconds' => env('TYPESENSE_HEALTHCHECK_INTERVAL_SECONDS', 30), + 'num_retries' => env('TYPESENSE_NUM_RETRIES', 3), + 'retry_interval_seconds' => env('TYPESENSE_RETRY_INTERVAL_SECONDS', 1), ], - 'nearest_node' => [ - 'host' => env('TYPESENSE_HOST', 'localhost'), - 'port' => env('TYPESENSE_PORT', '8108'), - 'path' => env('TYPESENSE_PATH', ''), - 'protocol' => env('TYPESENSE_PROTOCOL', 'http'), - ], - 'connection_timeout_seconds' => env('TYPESENSE_CONNECTION_TIMEOUT_SECONDS', 2), - 'healthcheck_interval_seconds' => env('TYPESENSE_HEALTHCHECK_INTERVAL_SECONDS', 30), - 'num_retries' => env('TYPESENSE_NUM_RETRIES', 3), - 'retry_interval_seconds' => env('TYPESENSE_RETRY_INTERVAL_SECONDS', 1), - 'table_configurations' => [ + 'model_configuration' => [ // 'users' => [ // name of the table // 'name' => 'users', // name of the table // 'fields' => [ diff --git a/src/EngineManager.php b/src/EngineManager.php index 1ec98a84..e232a122 100644 --- a/src/EngineManager.php +++ b/src/EngineManager.php @@ -151,7 +151,7 @@ public function createTypesenseDriver() { $this->ensureTypesenseClientIsInstalled(); - return new TypesenseEngine(new Typesense(config('scout.typesense'))); + return new TypesenseEngine(new Typesense(config('scout.typesense.client_configuration'))); } /** diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 9c9913b3..7060f24a 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -509,7 +509,7 @@ protected function getOrCreateCollectionFromModel($model): TypesenseCollection return $index; } catch (ObjectNotFound $exception) { - $schema = config('scout.typesense.table_configurations.'.$model->getTable()) ?? []; + $schema = config('scout.typesense.model_configuration.'.$model->getTable()) ?? []; $this->typesense->getCollections()->create($schema);