The query_scope option for search indexes, added in statamic/cms#13126 (6.0), isn't documented on the Search page. The page covers filter, and the 5 to 6 upgrade guide already recommends query scopes over filtering for custom searchables, but it doesn't say how to set one on an index.
From Statamic\Search\Searchables\Provider::applyQueryScope() and the built-in searchables on 6.x, these are worth covering:
- The value is a scope handle. The scope is applied to the query before any items are loaded, which is why it's faster than
filter on large indexes.
- Unlike
filter, it doesn't override the native filters, so draft entries are still left out of the index.
- The entries, terms and users searchables apply it. The assets searchable doesn't.
I'll open a PR for this.
The
query_scopeoption for search indexes, added in statamic/cms#13126 (6.0), isn't documented on the Search page. The page coversfilter, and the 5 to 6 upgrade guide already recommends query scopes over filtering for custom searchables, but it doesn't say how to set one on an index.From
Statamic\Search\Searchables\Provider::applyQueryScope()and the built-in searchables on6.x, these are worth covering:filteron large indexes.filter, it doesn't override the native filters, so draft entries are still left out of the index.I'll open a PR for this.