Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Document the `query_scope` search index option

未關閉
#1,997 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@joshdaugherty 已經在處理了。

開始於 2026年9月29日。

  • #1998 來自 @joshdaugherty —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
18/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
php
領域
documentation

研究方向

The work is the Search page of the docs repo, plus the 5 to 6 upgrade guide's mention of query scopes. The behaviour to describe is in Statamic\Search\Searchables\Provider::applyQueryScope() in the CMS source on 6.x. Pull request #1998 is already open against this issue, so review it before starting; a newcomer's contribution would be a review comment, not a second PR.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
PHP
星號
133
分支
405
平均合併
2 天 2 小時
30 天內合併 PR
11

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

statamic/docs 的其他 Issue

查看 statamic/docs 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。