File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,24 @@ protected $hidden = [
265265
266266## Usage
267267
268+ ``` php
269+ // plainto_tsquery()
270+ $results = App\Post::search('cat rat')->usingPlainQuery()->get()
271+
272+ // plainto_tsquery()
273+ $results = App\Post::search('cat rat')->usingPhraseQuery()->get()
274+
275+ // to_tsquery()
276+ $results = App\Post::search('fat & (cat | rat)')->usingTsQuery()->get()
277+
278+ // DIY using a callback
279+ use ScoutEngines\Postgres\TsQuery\ToTsQuery;
280+
281+ $results = App\Post::search('fat & (cat | rat)', function ($builder, $config) {
282+ return new ToTsQuery($builder->query, $config);
283+ })->get();
284+ ```
285+
268286Please see the [ official documentation] ( http://laravel.com/docs/master/scout ) on how to use Laravel Scout.
269287
270288## Testing
You can’t perform that action at this time.
0 commit comments