From 2c3021756e2b175e992cc66e1e10447f70e89506 Mon Sep 17 00:00:00 2001 From: Ramon Rietdijk Date: Thu, 17 Oct 2024 18:38:42 +0200 Subject: [PATCH] Fixed code snippet --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66d0895..d5588f9 100644 --- a/README.md +++ b/README.md @@ -280,11 +280,11 @@ Full list of ElasticSearch terms is in `vendor/handcraftedinthealps/elasticsearc You can do it with `MixedSearch` class, just pass indices names separated by commas to the `within` method. ```php MixedSearch::search('title:Barcelona or to:Barcelona') - within(implode(',', [ + ->within(implode(',', [ (new Ticket())->searchableAs(), (new Book())->searchableAs(), ])) -->get(); + ->get(); ``` In this example you will get collection of `Ticket` and `Book` models where ticket's arrival city or book title is `Barcelona`