Skip to content

Commit

Permalink
Config Params
Browse files Browse the repository at this point in the history
  • Loading branch information
karakhanyans committed Nov 9, 2023
1 parent e0264c0 commit 18d08f6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
30 changes: 16 additions & 14 deletions config/scout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
2 changes: 1 addition & 1 deletion src/EngineManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Engines/TypesenseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 18d08f6

Please sign in to comment.