@@ -562,24 +562,27 @@ 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 |
577-
578-
579- #### Text search with trash
580-
581- Because the Laravel Scout Builder is not built the same as the Eloquent one, ` withTrashed ` instruction is not a scope
582- anymore and work differently:
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)
583586
584587``` json
585588// (POST) api/posts/search
@@ -592,17 +595,3 @@ anymore and work differently:
592595 }
593596}
594597```
595-
596- or for ` onlyTrashed ` :
597-
598- ``` json
599- // (POST) api/posts/search
600- {
601- "search" : {
602- "text" : {
603- "value" : " my text search" ,
604- "trashed" : " only"
605- }
606- }
607- }
608- ```
0 commit comments