共用方式為


sp_fulltext_service (Transact-SQL)

Applies to:SQL Server

變更 SQL Server 全文搜尋的伺服器屬性。

Caution

upgrade_option SQL Server 2022 (16.x) 和更新版本不支援此動作。 如需詳細資訊,請參閱 本文稍後的<與 SQL Server 2022 和更新版本的 相容性>一節。

Transact-SQL 語法慣例

Syntax

sp_fulltext_service
    [ [ @action = ] N'action' ]
    [ , [ @value = ] value ]
[ ; ]

Arguments

[ @action = ] N'action'

要變更或重設的屬性。 @action is nvarchar(100), with no default. For a list of @action properties, their descriptions, and the values that can be set, see the table under the @value argument.

這個自變數會傳回下列屬性:

  • 資料類型
  • 目前的執行值
  • 最小值或最大值
  • 如果適用,取代狀態。

[ @value = ] value

@value is sql_variant, with a default of NULL.

指定之屬性的值。 @value is sql_variant, with a default value of NULL. If @value is null, sp_fulltext_service returns the current setting. 下表列出動作屬性、其描述,以及可設定的值。

Note

SQL Server 的未來版本中將會移除下列動作: clean_upconnect_timeoutdata_timeoutresource_usage。 請避免在新的開發工作中使用這些動作,並計劃修改目前使用其中任何動作的應用程式。

Action Data type Description
clean_up int 支援這個項目的目的,只是為了與舊版相容。 值一律 0為 。
connect_timeout int 支援這個項目的目的,只是為了與舊版相容。 值一律 0為 。
data_timeout int 支援這個項目的目的,只是為了與舊版相容。 值一律 0為 。
load_os_resources int 指出操作系統斷詞工具、字幹分析器和篩選是否註冊並搭配這個SQL Server 實例使用。 One of:

0 = 只使用這個 SQL Server 實例特定的篩選和斷詞工具。

1 = 載入作業系統篩選和斷詞工具。

根據預設,這個屬性會停用,以防止對操作系統進行更新的不小心行為變更。 啟用操作系統資源的使用,可讓您存取未安裝實例特定資源之Microsoft索引服務所註冊之語言和檔類型的資源。 如果您啟用作業系統資源的載入,請確定操作系統資源是受信任的已簽署二進位檔;否則,當 設定為 verify_signature1,就無法載入它們。
master_merge_dop int 指定主要合併進程要使用的線程數目。 此值不應超過可用的CPU或CPU核心數目。

未指定此自變數時,服務會使用 較小的 4、或可用的CPU或CPU核心數目。
pause_indexing int 指定是否應該暫停全文檢索索引,如果目前正在執行,或繼續,如果目前暫停。

0 = 繼續伺服器實例的全文檢索索引活動。

1 = 暫停伺服器實例的全文檢索索引活動。
resource_usage int SQL Server 2008 (10.0.x) 和更新版本中沒有函式,而且會被忽略。
update_languages NULL 更新以全文搜索註冊的語言和篩選清單。 設定索引和全文檢索查詢時會指定語言。 Filters are used by the filter daemon host to extract textual information from corresponding file formats such as .docx stored in data types, such as varbinary, varbinary(max), image, or xml, for full-text indexing.

如需詳細資訊,請參閱 檢視或變更已註冊的篩選和斷詞工具
upgrade_option int 控制將資料庫從 SQL Server 2005 (9.x) 升級至更新版本時,全文檢索索引的移轉方式。 這個屬性適用於以下方式的升級:附加資料庫、還原資料庫備份、還原檔案備份,或是使用複製資料庫精靈複製資料庫。

One of:

- 0 = 使用新的和增強的斷詞工具重建全文檢索目錄。 重建索引可能需要一些時間,升級之後可能需要大量的 CPU 和記憶體。

- 1 = 全文檢索目錄重設。 SQL Server 2005 (9.x) 全文檢索目錄檔案會遭到移除,但是全文檢索目錄和全文檢索索引的中繼資料則會保留。 升級之後,所有全文檢索索引都會停用以進行變更追蹤,而且不會自動啟動編目。 當您在升級完成之後手動發出完整母體擴展之前,此目錄將會維持空白狀態。

- 2 = 匯入全文檢索目錄。 一般而言,匯入速度比重建更快。 例如,只有使用一個 CPU 時,匯入的執行速度大約比重建的速度快 10 倍。 不過,匯入的全文檢索目錄不會使用新的和增強的斷詞工具,因此您可能會想要改為重建全文檢索目錄。 在 SQL Server 2022 (16.x) 和更新版本中移除,並引發錯誤。

Note: Rebuild can run in multi-threaded mode, and if more than 10 CPUs are available, rebuild might run faster than import if you allow rebuild to use all of the CPUs.

如果全文檢索目錄無法使用,則會重建相關聯的全文檢索索引。 此選項僅適用於 SQL Server 2005 (9.x) 資料庫。

如需選擇全文檢索升級選項的資訊,請參閱升級全文檢索搜尋

Note: To set this property in SQL Server Management Studio, use the Full-Text Upgrade Option property. 如需詳細資訊,請參閱 管理及監視伺服器執行個體的全文檢索搜尋
verify_signature 1 int 指出全文檢索引擎是否只載入已簽署的二進位檔。 依預設,只會載入受信任的已簽署之二進位檔。

1 = 確認只載入受信任的已簽署二進位檔 (預設值)。

0 = 不要驗證二進位檔是否已簽署。

1 When verify_signature is 1, the Full-Text Engine only checks the cached Certificate Revocation List (CRL) before loading binaries. You should periodically refresh your local CRL cache with certutil, when using third party binaries.

傳回碼值

0 (成功) 或 1 (失敗)。

Result set

None.

與 SQL Server 2022 和更新版本的相容性

SQL Server 2022 (16.x) 和更新版本中會移除動作upgrade_option中的匯入功能@action = 'upgrade_option', @value = 2。 如果您需要從舊版 SQL Server 匯入全文檢索索引,您可以使用 SQL Server 2019 (15.x) 或舊版匯入它,然後升級至 SQL Server 2022 (16.x)。

Permissions

Only members of the serveradmin fixed server role or the system administrator can execute sp_fulltext_service.

Examples

A. 更新已註冊語言的清單

下列範例會更新以全文搜索註冊的語言清單。

EXECUTE sp_fulltext_service 'update_languages';
GO

B. 變更全文檢索升級選項以重設全文檢索目錄

下列範例會變更全文檢索升級選項來重設全文檢索目錄,並將它們完全移除。 This example specifies the optional @action and @value arguments.

EXECUTE sp_fulltext_service
    @action = 'upgrade_option',
    @value = 1;
GO