@@ -562,15 +562,36 @@ If you want to specify a full text search you'll need to use the text argument.
562562
563563When using full text search, some restrictions happens to the query:
564564
565- | ** Key** | ** Changes** |
566- | ---------------------| --------------------------------------------------------|
567- | ** Scopes** | |
568- | ` scopes.name ` | Not allowed |
569- | ` scopes.parameters ` | Not allowed |
570- | ** Filters** | |
571- | ` filters.field ` | take scout fields instead of fields in resource detail |
572- | ` filters.operator ` | ` = ` /` in ` /` not in ` |
573- | ` filters.type ` | Not allowed |
574- | ` filters.nested ` | Not allowed |
575- | ** Sorts** | |
576- | ` sorts.field ` | take scout fields instead of fields in resource detail |
565+ | ** Key** | ** Changes** |
566+ | ---------------------| -----------------------------------------------------------------|
567+ | ** Scopes** | |
568+ | ` scopes.name ` | Not allowed |
569+ | ` scopes.parameters ` | Not allowed |
570+ | ** Filters** | |
571+ | ` filters.field ` | take scout fields instead of fields in resource detail |
572+ | ` filters.operator ` | ` = ` /` in ` /` not in ` |
573+ | ` filters.type ` | Not allowed |
574+ | ` filters.nested ` | Not allowed |
575+ | ** Sorts** | |
576+ | ` sorts.field ` | uses Scout fields instead of fields defined in resource details |
577+
578+ #### Text search with trashed models
579+
580+ Because the Laravel Scout Builder differs from Eloquent, ` withTrashed ` is not a scope when performing text search.
581+ Instead, control trashed handling via the ` text.trashed ` option:
582+
583+ - "with" → include both non-trashed and trashed records
584+ - "only" → include only trashed records
585+ - omitted → exclude trashed records (default)
586+
587+ ``` json
588+ // (POST) api/posts/search
589+ {
590+ "search" : {
591+ "text" : {
592+ "value" : " my text search" ,
593+ "trashed" : " with"
594+ }
595+ }
596+ }
597+ ```
0 commit comments