新增或移除 SharePoint Server 中的搜尋索引的檔案類型Add or remove a file type from the search index in SharePoint Server

摘要:了解如何新增或移除搜尋索引的檔案類型,以及如何啟動或停止在搜尋索引中包含的檔案類型的內容。Summary: Learn how to add or remove a file type from the search index and how to start or stop including content from the file type, in the search index.

在您開始之前,您可能會想要讀取預設編目檔案副檔名及剖析檔案類型的 SharePoint Server。本文列出預設的 SharePoint Server 2016 搜尋索引中包含的檔案類型。Before you start, you may want to read Default crawled file name extensions and parsed file types in SharePoint Server. This article lists the file types that SharePoint Server 2016 by default includes in the search index.

如果您的 SharePoint 環境是混合式和使用雲端混合式搜尋,您可以決定何種類型的儲存在您想要新增或移除 Office 365 索引的 SharePoint Server 中的檔案。在裝載編目元件在雲端 Search service 應用程式的伺服器上使用下列程序。If your SharePoint environment is hybrid and uses cloud hybrid search, you can decide what types of files that are stored in SharePoint Server that you want to add or remove from the Office 365 index. Use the following procedures on the server that hosts the crawl component in the cloud Search service application.

在搜尋索引中新增或移除檔案類型:To add or remove a file type from the search index:

  1. 新增或移除副檔名清單中的 [管理檔案類型] 頁面上的檔案副檔名。請參閱 <新增或移除副檔名從 [管理檔案類型] 頁面Add or remove the file name extension from the list of file name extensions on the Manage File Types page. See Add or remove file name extensions from the Manage File Types page.

  2. 對此變更可能影響的所有內容來源執行完整編目。Run a full crawl for all content sources that this change might affect.

當完整編目完成時,搜尋索引就會包含/排除您已新增/移除之檔案類型中的屬性。When the full crawl finishes, the search index will include or exclude properties from files of the type that you have either added or removed.

開始在搜尋索引中包含某檔案類型的內容:To start including content from a file type, in the search index:

  1. 在主控內容處理元件的 Search service 應用程式中的伺服器,請檢查是否的內建格式處理常式或協力廠商篩選器型格式處理常式 (iFilter) 所支援的檔案類型的格式。內建格式處理常式是指已預設 SharePoint Server。請參閱檢視可剖析的檔案格式的資訊On a server that hosts a content processing component in the Search service application, check whether the format of the file type is supported by a built-in format handler or a third-party filter-based format handler (iFilter). Built-in format handlers are the those that SharePoint Server has by default. See View information about file formats that can be parsed.

  2. 若伺服器沒有該檔案類型適用的格式處理常式,請在所有裝載 Search Service 應用程式之內容處理元件的伺服器上,安裝協力廠商篩選器型格式處理常式。請遵循協力廠商格式處理常式的製造商所提供的安裝指引。If the server does not have a format handler for the file type, install a third-party filter-based format handler on all servers hosting content processing components in the Search service application. Follow the installation guidance given by the manufacturer of the third-party format handler.

  3. 在裝載內容處理元件的 Search service 應用程式中的所有伺服器上啟用剖析之格式的檔案與檔案的副檔名。請參閱啟用或停用剖析檔案格式On all servers that host a content processing component in the Search service application, enable parsing of the format of the file and the file name extension. See Enable or disable parsing of a file format.

  4. 對此變更可能影響的所有內容來源執行完整編目。Run a full crawl for all content sources that this change might affect.

當完整編目完成時,搜尋索引就會包含您已啟用之檔案類型的檔案內容。When the full crawl finishes, the search index will include content from files of the type that you enabled.

停止在搜尋索引中包含某檔案類型的內容:To stop including content from a file type, in the search index:

  1. 在主控內容處理元件的 Search service 應用程式中的伺服器,請檢查是否的內建格式處理常式或協力廠商篩選器型格式處理常式 (iFilter) 所支援的檔案類型的格式。內建格式處理常式是指 SharePoint 伺服器具有預設。On a server that hosts a content processing component in the Search service application, check whether the format of the file type is supported by a built-in format handler or a third-party filter-based format handler (iFilter). Built-in format handlers are those that SharePoint Server has by default.

  2. 在裝載內容處理元件的 Search service 應用程式中的所有伺服器上停用剖析之格式的檔案與檔案的副檔名。請參閱啟用或停用剖析檔案格式On all servers that host a content processing component in the Search service application, disable parsing of the format of the file and the file name extension. See Enable or disable parsing of a file format.

  3. 對此變更可能影響的所有內容來源執行完整編目。Run a full crawl for all content sources that this change might affect.

當完整編目完成時,搜尋索引就會排除您已停用之檔案類型的檔案內容。When the full crawl finishes, the search index will exclude content from files of the type that you disabled.

在 [管理檔案類型] 頁面中新增或移除副檔名Add or remove file name extensions from the Manage File Types page

將副檔名新增至 [管理檔案類型] 頁面上To add a file name extension to the Manage File Types page

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [檔案類型。管理檔案類型] 頁面隨即顯示。On the Search Administration page, in the Crawling section, click File types. The Manage File Types page appears.

  5. 按一下 [新增檔案類型Click New File Type.

  6. 在 [副檔名] 方塊中輸入您想要新增的檔案類型副檔名。In the File extension box, type the extension of the file type that you want to add.

  7. 按一下 [ OK ]。Click OK.

  8. 驗證:確定副檔名出現在 [管理檔案類型] 頁面上的檔案類型清單中。Verification: make sure that the extension appears in the list of file types on the Manage File Types page.

若要從 [管理檔案類型] 頁面中移除副檔名To remove a file name extension from the Manage File Types page

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在管理中心的 [應用程式管理] 區段中按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  3. 在 [管理服務應用程式] 頁面上,按一下服務應用程式清單中的 [Search Service 應用程式]。On the Manage Service Applications page, in the list of service applications, click the Search service application.

  4. 在 [搜尋管理] 頁面上的 [正在編目] 區段中按一下 [檔案類型。管理檔案類型] 頁面隨即顯示。On the Search Administration page, in the Crawling section, click File types. The Manage File Types page appears.

  5. 指向您要移除,請按一下箭號,然後按一下 [刪除顯示的檔案類型。Point to the file type that you want to remove, click the arrow that appears and then click Delete.

  6. 按一下[確定]確認您想要刪除之檔案類型]。Click OK to confirm that you want to delete the file type.

  7. 驗證:確定副檔名不再出現在 [管理檔案類型] 頁面上的檔案類型清單中。Verification: make sure that the extension no longer appears in the list of file types on the Manage File Types page.

檢視可剖析之檔案格式的相關資訊View information about file formats that can be parsed

對於內容處理元件已提供適當格式處理常式的檔案格式,若要檢視其相關資訊,您必須使用 Windows PowerShell。To view information about the file formats that the content processing component has format handlers for, you have to use Windows PowerShell.

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on the server.

  3. 在 Microsoft PowerShell 命令提示字元處,輸入下列命令:At the Microsoft PowerShell command prompt, type the following commands:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    Get-SPEnterpriseSearchFileFormat -SearchApplication $ssa
    

    結果是內容處理元件的 Search service 應用程式所參照的所有檔案格式的清單$ssa可剖析。每個檔案格式清單顯示:The result is a list of all file formats that the content processing component in the Search service application referenced by $ssa can parse. For each file format the list shows:

    • 副檔名和 MIME 類型The file name extension and mime type

    • 內容處理元件 」 使用剖析之格式的格式處理常式的類型。項目"BuiltIn:True"表示內建格式處理常式。項目"BuiltIn:False"表示協力廠商篩選器型格式處理常式。The type of format handler that the content processing component uses to parse the format. The entry "BuiltIn:True" indicates a built-in format handler. The entry "BuiltIn:False" indicates a third-party filter-based format handler.

    • 格式的剖析的狀態。項目"啟用: True"表示已啟用 [剖析。項目"啟用: False"表示已停用剖析。The parsing state of the format. The entry "Enabled:True" indicates that parsing is enabled. The entry "Enabled:False" indicates that parsing is disabled.

啟用或停用剖析檔案格式Enable or disable parsing of a file format

若要啟用或停用剖析檔案格式,您必須使用 Windows PowerShell。To enable or disable parsing of a file format, you have to use Windows PowerShell.

若要啟用以內建格式處理常式的檔案格式的剖析To enable parsing of a file format using a built-in format handler

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在裝載內容處理元件的伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on the server that hosts the content processing component.

  3. 在 Microsoft PowerShell 命令提示字元處,輸入下列命令:At the Microsoft PowerShell command prompt, type the following commands:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    Set-SPEnterpriseSearchFileFormatState -SearchApplication $ssa FormatID $TRUE
    

    其中:Where:

    FormatID 是檔案格式的身分識別。FormatID is the identity of the file format.

    $TRUE 會啟用格式處理常式來剖析檔案類型。$TRUE enables the format handler to parse the file type.

  4. 重新啟動 SharePoint 搜尋主機控制器服務以套用變更:Restart the SharePoint Search Host Controller service to apply the changes:

    • 開啟命令提示視窗中裝載內容處理元件的伺服器上。在 [開始] 功能表上按一下 [所有程式]、 [附屬應用程式、 用滑鼠右鍵按一下 [命令提示字元處,然後按一下 [以系統管理員身分執行Open a command prompt window on the server that hosts the content processing component. On the Start menu, click All Programs, click Accessories, right-click Command Prompt and then click Run as administrator.

    • 若要停止 SharePoint 搜尋主機控制器,輸入此命令: net stop spsearchhostcontrollerTo stop the SharePoint Search Host Controller, type this command: net stop spsearchhostcontroller

    • 如果要重新啟動 SharePoint 搜尋主機控制器,輸入此命令: net start spsearchhostcontrollerTo restart the SharePoint Search Host Controller, type this command: net start spsearchhostcontroller

  5. 驗證:顯示清單檔案的副檔名和檔案格式的內容處理元件可以剖析,並確定副檔名是否有。請參閱檢視可剖析的檔案格式的資訊Verification: show the list of file name extensions and file formats that the content processing component can parse and make sure that the file name extension is there. See View information about file formats that can be parsed.

若要停用剖析檔案格式使用的內建格式處理常式To disable parsing of a file format using a built-in format handler

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在裝載內容處理元件的伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on the server that hosts the content processing component.

  3. 在 Microsoft PowerShell 命令提示字元處,輸入下列命令:At the Microsoft PowerShell command prompt, type the following commands:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    Set-SPEnterpriseSearchFileFormatState -SearchApplication $ssa FormatID $FALSE
    

    其中:Where:

    FormatID 是檔案格式的身分識別。FormatID is the identity of the file format.

    $FALSE 會停用格式處理常式不要剖析檔案類型。$FALSE disables the format handler from parsing the file type.

  4. 重新啟動 SharePoint 搜尋主機控制器服務以套用變更:Restart the SharePoint Search Host Controller service to apply the changes:

    • 開啟命令提示視窗中裝載內容處理元件的伺服器上。在 [開始] 功能表上按一下 [所有程式]、 [附屬應用程式、 用滑鼠右鍵按一下 [命令提示字元處,然後按一下 [以系統管理員身分執行Open a command prompt window on the server that hosts the content processing component. On the Start menu, click All Programs, click Accessories, right-click Command Prompt and then click Run as administrator.

    • 若要停止 SharePoint 搜尋主機控制器,輸入此命令: net stop spsearchhostcontrollerTo stop the SharePoint Search Host Controller, type this command: net stop spsearchhostcontroller

    • 如果要重新啟動 SharePoint 搜尋主機控制器,輸入此命令: net start spsearchhostcontrollerTo restart the SharePoint Search Host Controller, type this command: net start spsearchhostcontroller

  5. 驗證:顯示清單檔案的副檔名和檔案格式的內容處理元件可以剖析並確定副檔名不存在。請參閱檢視可剖析的檔案格式的資訊Verification: show the list of file name extensions and file formats that the content processing component can parse and make sure that the file name extension is not there. See View information about file formats that can be parsed.

若要啟用剖析檔案格式使用的協力廠商篩選器型格式處理常式To enable parsing of a file format using a third-party filter-based format handler

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在裝載內容處理元件的伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on the server that hosts the content processing component.

  3. 在 Microsoft PowerShell 命令提示字元處,輸入下列命令:At the Microsoft PowerShell command prompt, type the following commands:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    New-SPEnterpriseSearchFileFormat -SearchApplication $ssa FileNameExtension FileFormat application/FileApplication
    

    其中:Where:

    FileNameExtension 是檔案類型的副檔名。FileNameExtension is the file name extension of the file type.

    FileFormat 是檔案類型的格式。格式通常為應用程式的名稱。FileFormat is the format of the file type. The format is often the name of the application.

    應用程式/FileApplication 是檔案類型的 mime 類型。Mime 類型必須包含類型及子類型。在這個範例中,應用程式類型與 FileApplication 子類型。例如 Word 檔案類型是應用程式和子類型是 msword。他們一起形成完整的 mime 類型: 應用程式/msword。application/FileApplication is the mime type of the file type. The mime type must consist of a type and a subtype. In this example, application is the type and FileApplication is the subtype. For example, for Word files, the type is application and the subtype is msword. Together they form the complete mime type: application/msword.

  4. 重新啟動 SharePoint 搜尋主機控制器服務以套用變更:Restart the SharePoint Search Host Controller service to apply the changes:

    • 開啟命令提示視窗中裝載內容處理元件的伺服器上。在 [開始] 功能表上按一下 [所有程式]、 [附屬應用程式、 用滑鼠右鍵按一下 [命令提示字元處,然後按一下 [以系統管理員身分執行Open a command prompt window on the server that hosts the content processing component. On the Start menu, click All Programs, click Accessories, right-click Command Prompt and then click Run as administrator.

    • 若要停止 SharePoint 搜尋主機控制器,輸入此命令: net stop spsearchhostcontrollerTo stop the SharePoint Search Host Controller, type this command: net stop spsearchhostcontroller

    • 如果要重新啟動 SharePoint 搜尋主機控制器,輸入此命令: net start spsearchhostcontrollerTo restart the SharePoint Search Host Controller, type this command: net start spsearchhostcontroller

  5. 驗證:顯示清單檔案的副檔名和檔案格式的內容處理元件可以剖析,並確定副檔名是否有。請參閱檢視可剖析的檔案格式的資訊Verification: show the list of file name extensions and file formats that the content processing component can parse and make sure that the file name extension is there. See View information about file formats that can be parsed.

若要停用剖析檔案格式使用的協力廠商篩選器型格式處理常式To disable parsing of a file format using a third-party filter-based format handler

  1. 確認執行此程序的使用者帳戶是否為 Search Service 應用程式的管理員。Verify that the user account that is performing this procedure is an administrator for the Search service application.

  2. 在裝載內容處理元件的伺服器上啟動 SharePoint 管理命令介面。Start a SharePoint Management Shell on the server that hosts the content processing component.

  3. 在 Microsoft PowerShell 命令提示字元處,輸入下列命令:At the Microsoft PowerShell command prompt, type the following commands:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    Remove-SPEnterpriseSearchFileFormat -SearchApplication $ssa -Identity FileNameExtension
    

    其中:Where:

    FileNameExtension 是檔案類型的副檔名。FileNameExtension is the file name extension of the file type.

  4. 重新啟動 SharePoint 搜尋主機控制器服務以套用變更:Restart the SharePoint Search Host Controller service to apply the changes:

    • 開啟命令提示視窗中裝載內容處理元件的伺服器上。在 [開始] 功能表上按一下 [所有程式]、 [附屬應用程式、 用滑鼠右鍵按一下 [命令提示字元處,然後按一下 [以系統管理員身分執行Open a command prompt window on the server that hosts the content processing component. On the Start menu, click All Programs, click Accessories, right-click Command Prompt and then click Run as administrator.

    • 若要停止 SharePoint 搜尋主機控制器,輸入此命令: net stop spsearchhostcontrollerTo stop the SharePoint Search Host Controller, type this command: net stop spsearchhostcontroller

    • 如果要重新啟動 SharePoint 搜尋主機控制器,輸入此命令: net start spsearchhostcontrollerTo restart the SharePoint Search Host Controller, type this command: net start spsearchhostcontroller

  5. 驗證:顯示清單檔案的副檔名和檔案格式的內容處理元件可以剖析並確定副檔名不存在。請參閱檢視可剖析的檔案格式的資訊Verification: show the list of file name extensions and file formats that the content processing component can parse and make sure that the file name extension is not there. See View information about file formats that can be parsed.