FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Document the `query_scope` search index option · Issue #1997 · statamic/docs · GitHub

Repository navigation

Document the query_scope search index option #1997

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL