SharePoint Server 的搜尋結構描述概觀Overview of the search schema in SharePoint Server

摘要: 了解如何使用搜尋結構描述來建置搜尋索引。搜尋結構描述包含從編目屬性對應到 Managed 屬性以及 Managed 屬性上的設定。Summary: Learn how the search schema is used to build up the search index. The search schema contains the mapping from crawled properties to managed properties and the settings on the managed properties.

搜尋索引是搜尋的核心。搜尋索引中的物件決定了使用者輸入搜尋查詢或與網際網路或內部網路網頁互動來尋找資訊時可以找到的物件。The search index is the center of search. What is in your search index determines what people will find when they look for information by entering search queries or by interacting with internet or intranet pages.

本文說明內容的收集標準以及如何使用搜尋結構描述從搜尋索引擷取內容。搜尋結構描述包含編目屬性、編目屬性類別、編目 Managed 屬性對應以及 Managed 屬性設定。Managed 屬性設定定義了您可以搜尋的項目和方法,例如,您是否可以精簡屬性或查詢屬性。This article describes how content is collected in and retrieved from the search index by using the search schema. The search schema contains crawled properties, crawled property categories, the crawled to managed property mapping and the managed property settings. Managed property settings define what you can search for and how, for example if you can refine or query on a property.

編目與編目屬性Crawling and crawled properties

為了建立搜尋索引,必須先編目內容。您可以編目各種內容來源,例如:SharePoint Server 內容、檔案共用或使用者設定檔。編目項目的內容和中繼資料以「編目屬性」表示。To build up the search index, you must first crawl content. You can crawl various content sources, for example SharePoint Servercontent, file shares or user profiles. The contents and metadata of the items that you crawl are represented as crawled properties.

被編目並傳送到內容處理元件的每個項目,都會有關聯的編目屬性。屬性範例包括 AuthorTitle 以及 Creation Date 。任何新增的編目屬性都能夠被自動探索。Each item that has been crawled and passed on to the content processing component has crawled properties associated with it. Examples of properties are Author, Title, and Creation Date. Any new crawled properties will be discovered automatically.

編目屬性會依據項目的 IFilter 或通訊協定處理常式分組到各個類別。類別範例包括 Office (Word 文件、Excel 工作表的編目屬性等等)、 Business Data (範例資料庫的編目屬性) 以及 Web (網站的編目屬性)。Crawled properties are grouped into categories that are based on the IFilter or protocol handler of the item. Example categories are Office (crawled properties from Word documents, Excel worksheets, and so on), Business Data (crawled properties from for example databases), and Web (crawled properties from web sites).

如需編目的詳細資訊,請參閱在 SharePoint Server 中規劃編目及同盟For more information about crawling, see Plan crawling and federation in SharePoint Server.

Managed 屬性與屬性對應Managed properties and property mapping

若要在搜尋索引中包含編目屬性的內容和中繼資料,必須將編目屬性對應到 Managed 屬性。只有 Managed 屬性會被寫入搜尋索引。To include the contents and metadata of crawled properties in the search index, you must map crawled properties to managed properties. Only managed properties are written to the search index.

Managed 屬性可以包含許多設定。Managed 屬性上的設定決定了搜尋結果中內容的顯示方式,以及使用者搜尋的方式。Managed properties can have many settings. The settings on the managed property determine how the contents can be shown in search results and how people can search for it.

您可以將多個編目屬性對應至一個 Managed 屬性。例如,您可以將 "Writer" 和 "Author" 編目屬性對應到 "Author" Managed 屬性;或者,將單一編目屬性對應到多個 Managed 屬性。You can map multiple crawled properties to a single managed property. For example, you can map both the "Writer" and "Author" crawled properties to the "Author" managed property. Or, you can map a single crawled property to multiple managed properties.

另外,編目屬性對應至 Managed 屬性的順序會決定 Managed 屬性的內容。例如,Managed 屬性可以有多個對應的編目屬性,並且可設定為包含所有對應的編目屬性之中的所有值。但是,如果您提供的編目屬性所包含的 SharePoint 標題優先順序高於對應中的其他標題,則將在搜尋結果中顯示 SharePoint 標題。Also, the order in which crawled properties are mapped to a managed property can determine the content of a managed property. For example, a managed property can have multiple crawled properties mapped to it and can be set to includes all values from all crawled properties mapped to it. But, if you give the crawled property containing the SharePoint title priority over another title in the mapping, it will show the SharePoint title in the search results.

已定義一組預設編目及管理屬性之間的對應,請參閱 SharePoint Server 中的編目及管理屬性概觀A set of default mappings between crawled and managed properties has been defined, see Overview of crawled and managed properties in SharePoint Server.

有些編目屬性類型會自動產生新的 Managed 屬性,並在編目屬性與 Managed 屬性之間建立對應。例如,SharePoint 文件庫的所有網站欄都有這個自動產生及對應的功能。您在清單中建立網站欄並編目該清單的時候,就會為網站欄自動建立編目屬性、Managed 屬性以及編目屬性與 Managed 屬性之間的對應。Some crawled property types automatically generate a new managed property and a mapping between the crawled and managed property. For example, all site columns from SharePoint libraries have this automatic generation and mapping. When you create a site column in a list, and you crawl that list, a crawled property, a managed property, and a mapping between the crawled and managed property is automatically created for the site column.

您可以變更編目屬性與 Managed 屬性之間的預設對應或任何其他對應、建立新的對應或建立新的 Managed 屬性。建立新的 Managed 屬性或變更現有 Managed 屬性上的特定設定時,必須先完成完整編目,搜尋索引中才能包含新的 Managed 屬性及其值。如果新的或變更的屬性是在 SharePoint 文件庫或清單中,您可以針對該個別文件庫或清單重新編製索引,不需要啟動整個 SharePoint 內容來源的完整編目。這個動作的效果與完整編目相同。You can change the default mapping or any other mapping from crawled to managed properties, create new mappings, or create new managed properties. When you create a new managed property, or when you change certain settings on existing managed properties, a full crawl must complete before the managed property and its value is included in the search index. If the new or changed property is in a SharePoint library or list, you can reindex that individual library or list without starting a full crawl of the entire SharePoint content source. This has the same effect as a full crawl.

如需詳細資訊,請參閱本文後續的 Managed 屬性設定概觀表格。See the table Managed property settings overview later in this article for more information.

搜尋結構描述The search schema

搜尋結構描述儲存在搜尋管理資料庫中。搜尋結構描述包含:The search schema is stored in the Search Administration database. The search schema contains:

  • 編目屬性與 Managed 屬性之間的對應。這可以是一個編目屬性對一個 Managed 屬性、一個編目屬性對多個 Managed 屬性、多個編目屬性對一個 Managed 屬性或多個編目屬性對多個 Managed 屬性的對應。The mapping between crawled properties and managed properties. This can be a mapping from one crawled property to one managed property, from one to many, many to one or even a many to many mapping.

  • 將 Managed 屬性寫入搜尋索引的方式。例如,Managed 屬性的值應該寫入哪個全文索引,以及要寫入哪個權數群組 (內容)。How the managed properties should be written to the search index. For example, to which full-text index the values of the managed properties should be written and to which weight group (context).

  • 不同 Managed 屬性的設定。例如,是否依特定 Managed 屬性搜尋、查詢或縮小搜尋結果。The settings for the different managed properties. For example, if you can search on, query on, or refine search results by particular managed properties.

  • 依據屬性的 IFilter 或通訊協定處理常式將屬性分組的編目屬性類別。如果編輯編目屬性類別,這個變更會套用到該類別內的所有編目屬性。這會影響效能以及搜尋索引中項目的儲存方式。Crawled property categories that group properties according to their IFilter or protocol handler. If you edit a crawled property category, your changes apply to all of the crawled properties within the category. This can influence performance and how items are saved in the search index.

搜尋結構描述更新會每分鐘透過搜尋系統散佈出去。Search schema updates are propagated through the search system every minute.

多個搜尋結構描述Multiple search schemas

您可以建立多個搜尋結構描述。主搜尋結構定義於Search Service 應用程式,在管理中心中可以進行編輯。網站集合系統管理員與承租人系統管理員可以變更特定網站集合或承租人的搜尋結構描述。例如,網站集合系統管理員可以變更該網站集合的搜尋結構描述,自訂搜尋索引要包含的項目;這種作法可以自訂該網站集合的搜尋經驗。網站擁有者可以檢視搜尋結構描述,但不能變更它。You can create multiple search schemas. The main search schema is defined in the Search service application and can be edited in the Central Administration. Site collection administrators and tenant administrators can change the search schema for a particular site collection or tenant. For example, a site collection administrator can customize what is included in the search index by changing the search schema for that site collection and, by doing this, customize the search experience for that site collection. Site owners can view the search schema, but not change it.

注意

您無法檢視或變更管理中心中的網站集合搜尋結構。若要檢視或變更網站集合的搜尋結構,您必須使用 [網站集合管理]。You can't view or change the site collection search schema in Central Administration. To view or make changes in the search schema for a site collection, you have to use Site Collection Administration.

搜尋索引The search index

搜尋索引由伺服器上資料夾的一組檔案組成。內容處理元件會處理已編目的項目,使用搜尋結構描將編目屬性對應到 Managed 屬性,以及將 Managed 屬性轉譯為寫入搜尋索引的格式。除了各種全文檢索索引以外,還有個別的 Managed 屬性索引,分別標示為可擷取和可查詢。另外也有個別的屬性向量索引和數值索引。The search index consists of a set of files in folders on a server. The content processing component processes crawled items, uses the search schema to map crawled properties to managed properties, and translates the managed properties into a format that is written to the search index. In addition to various full-text indexes, there are separate indexes of the managed properties that are marked as retrievable and those that are marked as queryable. There is also a separate index for attribute vectors, and there are numeric indexes.

索引更新群組Index update groups

只要項目一變更,就必須在重新編目之後重新編製索引。為了降低重新編製索引的負荷,SharePoint Server 引入了數個個別的索引更新群組。Whenever an item changes, it must be re-indexed after it has been crawled again. To reduce the re-indexing load, SharePoint Server introduces several separate index update groups.

  • Default 包含大部分的 Managed 屬性。這個索引更新群組包含不屬於 Security、Link、Usage 或 People 索引更新群組的所有 Managed 屬性。Default Contains he majority of managed properties. This index update group contains all managed properties that do not belong to the Security, Link, Usage or People index update groups.

  • Security 包含文件存取控制清單 (ACL) Managed 屬性Security Contains the document Access Control List (ACL) managed property

  • Link 包含與連結結構相關的 Managed 屬性Link Contains the managed properties related to link structure

  • Usage 包含與使用狀況資料相關的 Managed 屬性Usage Contains the managed properties related to usage data

  • People 包含與人員搜尋相關的 Managed 屬性People Contains the managed properties related to people search

每個更新群組分別儲存於搜尋索引的個別資料夾。Each update group is stored in a different folder in the search index.

全文檢索索引Full-text index

全文檢索索引中包含所有可搜尋 Managed 屬性中的文字,儲存在全文檢索索引內。每個全文檢索索引被分為權數群組,也稱為內容。不同的內容與 Managed 屬性的相對重要性相關,這也是用來計算搜尋結果相關程度排名的排名功能之一。 內容的編號 (或 ID) 並不重要,排名模型是藉著指派比重加權給特定內容,來決定它的相對重要性。比重加權越高,排名分數也就越高。如需詳細資訊,請參閱<SharePoint Server 中的搜尋結果排名概觀>一文中的<使用搜尋結構描述影響搜尋結果的排名>小節。A full-text index contains all the text from the searchable managed properties that are stored in that full-text index. Each full-text index is divided into weight groups, also referred to as contexts. The different contexts relate to the relative importance of a managed property, which is one of the ranking features that are used to calculate the total relevance rank of a search result. The number, or ID, of a context is not important; the ranking model determines its relative importance by assigning a contribution weight to a particular context. A higher contribution weight results in a higher ranking score. For more information, see the section Influence the ranking of search results by using the search schema in the article Overview of search result ranking in SharePoint Server.

除了預設全文檢索索引之外,還有兩個預先定義的全文檢索索引:SharePoint Terms 全文檢索索引 (SpTermsIdx) 和 People 索引 (PeopleIdx)。There are two pre-defined full-text indexes other than the default full-text index: the SharePoint Terms full-text index ( SpTermsIdx ) and the People index ( PeopleIdx ).

依預設,大多數 Managed 屬性均已對應至合適的內容及全文檢索索引。建議您,不要變更任何現有可搜尋 Managed 屬性的內容。Most managed properties are already mapped to a suitable context and full-text index by default. We do not recommend changing the context of any of the existing searchable managed properties.

Managed 屬性設定概觀Managed property settings overview

Managed 屬性上的設定決定內容儲存在搜尋索引中的方式,以及使用者搜尋並擷取內容的方式。Settings on the managed properties determine how content is saved in the search index and if and how people can search for and retrieve it.

搜尋結構描述可以在管理中心、網站集合管理以及承租人管理中編輯。網站系統管理員可以檢視搜尋結構描述,但不能編輯它。下表說明不同的設定以及在不同的系統管理員層級上是否可以編輯它們。The search schema can be edited in Central Administration, Site Collection Administration and Tenant Administration. Site administrators can view the search schema, but they can't edit the search schema. The following table describes the different settings and whether they are available for editing on different administrator levels.

Managed 屬性設定Managed property setting 功能What it does 範例Example 可用於Available in 變更設定後所需的完整編目或重新編製索引 SharePoint 清單/文件庫Full crawl or reindex SharePoint list/library required after changing setting
可搜尋Searchable 能夠查詢 Managed 屬性的內容。這個 Managed 屬性的內容包含於全文檢索索引。Enables querying against the content of the managed property. The content of this managed property is included in the full-text index. 例如,如果屬性為 "author",則只要查詢 "Smith",即會傳回包含單字 "Smith" 的項目,以及作者屬性包含 "Smith" 的項目。If the property is "author", a simple query for "Smith" returns items that contain the word "Smith" and items whose author property contains "Smith". 管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration Yes
進階可搜尋設定Advanced Searchable Settings 可檢視及變更 Managed 屬性所寫入的全文檢索索引,也可讓您變更相關性排名計算的 Managed 屬性的內容。建議您,不要變更任何現有 Managed 屬性的內容。如需詳細資訊,請參閱<SharePoint Server 中的搜尋結果排名概觀>一文中的<使用搜尋結構描述影響搜尋結果的排名>小節。 Enables viewing and changing the full-text index that the managed property is written to. It also allows you to change the context of the managed property for the relevance rank calculation. We do not recommend changing the context of any of the existing managed properties. For more information, see the section Influence the ranking of search results by using the search schema in the article Overview of search result ranking in SharePoint Server. 管理中心 / 網站集合管理 / 租用戶管理Central Administration / Site Collection Administration / Tenant Administration Yes
可查詢Queryable 能夠查詢特定 Managed 屬性。Managed 屬性名稱必須包含於查詢中,可以在查詢本身中指定或者以程式設計的方式包含在查詢內。Enables querying against the specific managed property. The managed property name must be included in the query, either specified in the query itself or included in the query programmatically. 如果 Managed 屬性為 "author",查詢必須包含 "author:Smith"。If the managed property is "author", the query must contain "author:Smith". 管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration 從停用到啟用。From disabled to enabled.
可擷取Retrievable 讓搜尋結果能夠傳回此 Managed 屬性的內容。為相關的 Managed 屬性啟用這個設定,以便在搜尋結果中顯示。Enables the content of this managed property to be returned in search results. Enable this setting for managed properties that are relevant to present in search results. 管理中心 / 網站集合管理 / 租用戶管理Central Administration /Site Collection Administration /Tenant Administration 從停用到啟用。From disabled to enabled.
允許多個值Allow multiple values 允許此 Managed 屬性中同一個類型具有多個值。Allows multiple values of the same type in this managed property. 如果是 "author" Managed 屬性且文件有多位作者,將每位作者的名稱在 Managed 屬性中會儲存個別值。If this is the "author" managed property, and a document has multiple authors, each author name will be stored as a separate value in the managed property. 管理中心Central Administration Yes
可精簡搜尋Refinable Yes - active:能夠在前端使用屬性作為搜尋結果精簡器。您必須手動在網頁組件中設定精簡器。 Yes - active: Enables using the property as a refiner for search results in the front end. You must manually configure the refiner in the web part.

Yes - latent:能夠稍後將可精簡搜尋切換為啟用,而不用在切換時重新執行完整編目。Yes - latent: Enables switching refinable to active later, without having to do a full re-crawl when you switch.

這兩個選項都需要完整編目才能生效。Both options require a full crawl to take effect.

重要事項: 如果選取 [Yes - active] 或 [Yes - latent],必須也要將 Managed 屬性設定為可查詢。IMPORTANT: If you select Yes - active or Yes - latent, you must also make the managed property Queryable.
如果 "author"Managed 屬性是設定為可精簡搜尋,則稍後可以在搜尋前端將 Author 設定精簡器。If the "author" managed property is set to Refinable, you can set up Author as a refiner in your search front-end later. 管理中心Central Administration 從停用到啟用 (如果尚未設定為可排序)From disabled to enabled (if not already set to Sortable)
可排序Sortable Yes - active:能夠在結果集傳回前先按照屬性排序結果集。Yes - active: Enables sorting the result set based on the property before the result set is returned.

Yes - latent:能夠稍後將排序切換為啟用,而不用在切換時重新執行完整編目。Yes - latent: Enables switching sorting to active later without having to do a full re-crawl when you switch.

這兩個選項都需要完整編目才能生效。Both options require a full crawl to take effect.
用於無法同時排序和擷取的大型結果集。Use for large result sets that cannot be sorted and retrieved at the same time. 管理中心Central Administration 從停用到啟用 (如果尚未設定為 可精簡搜尋)From disabled to enabled (if not already set to Refinable)
別名Alias 如果想要在查詢和搜尋結果中使用別名而不是 Managed 屬性,這個設定可以定義 Managed 屬性的別名。請使用原來的 Managed 屬性而不是別名來對應編目屬性。Defines an alias for a managed property if you want to use the alias instead of the managed property name in queries and in search results. Use the original managed property and not the alias to map to a crawled property. 如果您不想或無權限建立新的 Managed 屬性,請使用別名。Use an alias if you don't want to or don't have permission to create a new managed property. 管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration No
Token 正規化Token normalization 能夠傳回與查詢中使用之字母大小寫和讀音符號無關的結果。Enables returning results independent of letter casing and diacritics used in the query. 查詢 "curacao" 也可以找到 "Curacao"、"curacao" 及 "Curacao" 的相符項目。The query "curacao" will also match "Curaçao", "curacao" and "Curacao". 管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration Yes
完全相符Complete matching 查詢只會找到內容完全一樣的屬性。Queries will only be matched against the exact content of the property. 如果您有 Managed 屬性 "ID" 包含字串 "1-23-456#7",完整比對只會傳回查詢 ID 為 "1-23-456#7" 的比對結果,而不會傳回 ID 為"1-23" 或 ID:"1 23 456 7" 的結果。If you have a managed property "ID" that contains the string "1-23-456#7", complete matching only returns results on the query ID:"1-23-456#7", and not on ID:"1-23" or ID:"1 23 456 7". 管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration Yes
對應到編目屬性Mappings to crawled properties 清單中顯示與該 Managed 屬性對應的所有編目屬性清單。Managed 屬性可以從一或多個編目屬性取得內容。The list shows all the crawled properties that are mapped to this managed property. A managed property can get its content from one or more crawled properties.

您可以包含所有編目屬性的內容或只包含第一個不是空的編目屬性以下的內容 (按照指定的順序)。You can either include content from all crawled properties or include content from the first crawled property that is not empty, based on a specified order.
管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration Yes
公司名稱擷取Company name extraction 編目新的或更新的項目時,能讓系統從 Managed 屬性擷取公司名稱實體。擷取的實體稍後可以用來設定精簡器。 Enables the system to extract company name entities from the managed property when crawling new or updated items. The extracted entities can later be used to set up refiners.

已經為公司名稱擷取內含一個預先填入的字典。系統會將原來的 Managed 屬性內容儲存在索引中,而且不變更內容,而且再將擷取的實體複製到 Managed 屬性 "companies"。"companies" Managed 屬性已設定為可搜尋、可查詢、可擷取、可排序和可精簡搜尋。 There is one pre-populated dictionary for company name extraction. The system saves the original managed property content unchanged in the index, and, in addition, copies the extracted entities to the managed property "companies". The "companies" managed property is configured to be searchable, queryable, retrievable, sortable and refinable.

您可以在字詞庫中編輯公司名稱字典。You can edit the company name dictionary in the Term Store.

如需詳細資訊,請參閱<在 SharePoint Server 中管理公司名稱擷取>。For more information, see Manage company name extraction in SharePoint Server.
管理中心 / 網站集合管理 / 承租人管理Central Administration / Site Collection Administration / Tenant Administration Yes
自訂實體擷取Custom entity extraction 允許一或多個自訂實體擷取器與此 Managed 屬性關聯。編目新的或更新的項目時,能讓系統從 Managed 屬性擷取實體。擷取的實體稍後可以用來設定精簡器。 Enables one or more custom entity extractors to be associated with this managed property. This enables the system to extract entities from the managed property when crawling new or updated items. The extracted entities can later be used to set up refiners.

如需詳細資訊,請參閱在 SharePoint Server 中建立及部署自訂實體擷取器For more information, see Create and deploy custom entity extractors in SharePoint Server.
管理中心 / 網站集合管理Central Administration / Site Collection Administration Yes

另請參閱See also

在 SharePoint Server 中管理搜尋結構描述Manage the search schema in SharePoint Server

編目及 managed properties in SharePoint Server 的概觀Overview of crawled and managed properties in SharePoint Server

在 SharePoint Server 中規劃編目及同盟Plan crawling and federation in SharePoint Server