Skip to content

Commit 27c737d

Browse files
committed
Merge branch 'scout-clarify-conditional-indexing' of https://github.com/driesvints/docs into driesvints-scout-clarify-conditional-indexing
2 parents f2e18af + 7d58954 commit 27c737d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scout.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,17 @@ Sometimes you may need to only make a model searchable under certain conditions.
262262
return $this->isPublished();
263263
}
264264

265+
Note that this is only applied when manipulating models through the `save` method, queries or relationships. Directly making models and collections searchable would still override this behavior.
266+
267+
// Applied to...
268+
App\Order::where('price', '>', 100)->searchable();
269+
$user->orders()->searchable();
270+
$order->save();
271+
272+
// Not applied to...
273+
$orders->searchable();
274+
$order->searchable();
275+
265276
<a name="searching"></a>
266277
## Searching
267278

0 commit comments

Comments
 (0)