From 52ca3a9287eedf018cd8d8c8bc29aee74a00fbec Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Tue, 24 May 2022 12:43:12 +0100 Subject: [PATCH 1/3] Adding Declaring Model Engine to Scout docs --- scout.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scout.md b/scout.md index 63b1a6eea11..c8da84d4608 100644 --- a/scout.md +++ b/scout.md @@ -8,6 +8,7 @@ - [Configuring Model Indexes](#configuring-model-indexes) - [Configuring Searchable Data](#configuring-searchable-data) - [Configuring The Model ID](#configuring-the-model-id) + - [Declaring The Model Engine](#declaring-model-engine) - [Identifying Users](#identifying-users) - [Database / Collection Engines](#database-and-collection-engines) - [Database Engine](#database-engine) @@ -209,6 +210,33 @@ By default, Scout will use the primary key of the model as model's unique ID / k } } + +### Declaring the Model engine + +By default, Scout will use the configured engine from your configuration. This can be overriden on a model basis by overriding the `searchableUsing` method from the `Searchable` trait: + + engine('meilisearch'); + } + } + ### Identifying Users From c4f2c5c7f483314cce217feec9c4280ed0f42147 Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Tue, 24 May 2022 12:46:41 +0100 Subject: [PATCH 2/3] Matching styling of docs by pulling in EngineManager namespace as import --- scout.md | 1 + 1 file changed, 1 insertion(+) diff --git a/scout.md b/scout.md index c8da84d4608..b2c9ad18677 100644 --- a/scout.md +++ b/scout.md @@ -220,6 +220,7 @@ By default, Scout will use the configured engine from your configuration. This c namespace App\Models; use Illuminate\Database\Eloquent\Model; + use Laravel\Scout\EngineManager; use Laravel\Scout\Searchable; class User extends Model From 1dd44fbf67f35644238fd0ce905e1ef2bfbdecb5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 May 2022 09:55:11 -0500 Subject: [PATCH 3/3] formatting --- scout.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scout.md b/scout.md index b2c9ad18677..772863e854f 100644 --- a/scout.md +++ b/scout.md @@ -8,7 +8,7 @@ - [Configuring Model Indexes](#configuring-model-indexes) - [Configuring Searchable Data](#configuring-searchable-data) - [Configuring The Model ID](#configuring-the-model-id) - - [Declaring The Model Engine](#declaring-model-engine) + - [Configuring Search Engines Per Model](#configuring-search-engines-per-model) - [Identifying Users](#identifying-users) - [Database / Collection Engines](#database-and-collection-engines) - [Database Engine](#database-engine) @@ -210,10 +210,10 @@ By default, Scout will use the primary key of the model as model's unique ID / k } } - -### Declaring the Model engine + +### Configuring Search Engines Per Model -By default, Scout will use the configured engine from your configuration. This can be overriden on a model basis by overriding the `searchableUsing` method from the `Searchable` trait: +When searching, Scout will typically use the default search engine specified in your application's `scout` configuration file. However, the search engine for a particular model can be changed by overriding the `searchableUsing` method on the model: