建立和匯入 SharePoint Server 中的同義字字典Create and import a thesaurus in SharePoint Server

摘要:了解如何建立和匯入 SharePoint Server 2016 和 SharePoint Server 2013 中的同義字字典。Summary: Learn how to create and import a thesaurus in SharePoint Server 2016 and SharePoint Server 2013.

在本文中,您將了解:In this article, you'll learn:

不同的人員。不要我們看起來並裝飾不同,不僅當我們通訊,我們使用不同的文字描述相同。相同適用於我們搜尋的資訊的方式。在搜尋引擎、 某個人可能輸入"花盆影像中,"而另一個可能輸入"花 picture"或"花 photo"。即使我們使用不同的片語,我們已搜尋相同的資訊。People are different. Not only do we look and dress differently, but when we communicate, we use different words to describe the same thing. The same applies to how we search for information. In a search engine, one person might enter "flower image," whereas another might enter "flower picture" or "flower photo." Even though we used different phrases, we were searching for the same information.

並沒有縮寫。縮寫特別常用在組織中,但我們搜尋的資訊,這可以是具挑戰性。例如,如果我們想要查看每月銷售報表,我們將很有可能搜尋其所使用的字詞每月銷售報表。但是建立此報表的人員可能會使用縮寫MSR 。如此,當我們搜尋每月銷售報表,會不傳回任何搜尋結果。And then there are acronyms. Acronyms are especially popular in organizations, but when we search for information, this can be challenging. For example, if we want to see the Monthly Sales Report, we'll most likely search for it by using the terms Monthly Sales Report . But, the people who create this report might use the acronym MSR . So, when we search for Monthly Sales Report , no search results are returned.

縮寫

在 SharePoint Server 中我們可以輕鬆地建立和上傳包含的搜尋字詞和縮寫同義字的同義字。在本文中,我們將使用的簡單範例示範如何執行這項作業。In SharePoint Server we can easily create and upload a thesaurus that contains synonyms for search phrases and acronyms. In this article, we'll use a simple example to show how to do this.

假設您有兩個文件庫中的圖片:Suppose you have two documents in a library:

  • Word 文件標題為"Coffee"A Word document titled "Coffee"

  • PowerPoint 文件標題為"杯子的 Joe"A PowerPoint document titled "Cup of Joe"

兩份文件

當您搜尋咖啡時,會傳回 Word 文件。When you search for coffee , the Word document is returned.

Coffee 結果

當您搜尋joe 杯時,會傳回 PowerPoint 文件。When you search for cup of joe , the PowerPoint document is returned.

Joe 結果

要傳回搜尋咖啡杯子 joe 的這兩個文件,我們可以建立同義字字典。For both documents to be returned when you search for either coffee or cup of joe , we can create a thesaurus.

如何建立同義字字典How to create a thesaurus

  1. 開啟文字編輯器,例如 [記事本]。Open a text editor, for example Notepad.

  2. 在文字編輯器中,輸入我們同義字的欄:索引鍵同義字、 和語言In the text editor, enter the columns of our thesaurus: Key , Synonym , and Language .

  3. 使用逗點分隔的文字。Use commas to separate the words.

    行 1

  4. 在新行上的文字編輯器中,輸入字詞或片語的同義字該字詞或片語以及兩個字母語言碼。請使用逗號分隔片語,例如咖啡、 Joe 杯子、 en-usOn a new line in the text editor, enter a term or a phrase, a synonym for that term or phrase and a two letter language code. Use commas to separate the phrases, for example Coffee,Cup of Joe,en .

    第 2 行

    這表示當使用者搜尋 」 咖啡",將會傳回"Coffee"和"Joe 杯子"的搜尋結果。This means that when users search for "Coffee", search results for both "Coffee" and "Cup of Joe" will be returned.

  5. 重複步驟 3 中,但切換機碼同義字的順序。Repeat step 3, but switch the order of Key and Synonym .

    行 3

    這表示當使用者搜尋"Joe 杯子",將會傳回"Joe 杯子"和"Coffee"的搜尋結果。This means that when users search for "Cup of Joe," search results for both "Cup of Joe" and "Coffee" will be returned.

  6. 將檔案儲存為.csv使用utf-8編碼。Save the file as .csv with UTF-8 encoding.

    儲存 CSV

現在我們已經建立我們同義字字典下, 一個工作就是匯入 SharePoint Server。Now that we've created our thesaurus, the next task is to import it to SharePoint Server.

如何匯入同義字字典How to import a thesaurus

注意

若要匯入同義字字典,您必須是Search service 應用程式管理員To import a thesaurus, you must be a Search service application administrator.

  1. 在伺服器上安裝 SharePoint Server,開啟SharePoint 管理命令介面On the server where SharePoint Server is installed, open a SharePoint Management Shell.

    SP Shell

  2. 在命令提示字元處輸入下列命令:At the command prompt, enter the following command:

    $searchApp = Get-SPEnterpriseSearchServiceApplication 
    Import-SPEnterpriseSearchThesaurus -SearchApplication $searchApp -Filename <Path>
    

其中<Path>是同義字檔案的 UNC 路徑。where <Path> is the UNC path of the thesaurus file.

執行指令碼

這是它 !That's it!

重要

當您匯入同義字字典時,就會覆寫現有的同義字。如果您想要將新的片語新增至我們同義字字典,您應將其新增至我們已匯入同義字字典檔案。您無法將匯出的同義字檔案。因此,您應該在外部系統,例如檔案共用上維護我們同義字檔案。When you import a thesaurus, the existing thesaurus will be overwritten. If you want to add new phrases to our thesaurus, you should add them to the thesaurus file we have already imported. You can't export a thesaurus file. Therefore, you should maintain our thesaurus file in an external system, for example on a file share.

若要驗證該您同義字字典運作想要的方式,搜尋的同義字詞。此範例案例,在這兩個檔案所傳回"coffee"和"joe 杯子"。To verify that you thesaurus is working the way that you want it to, search for phrases from the thesaurus. In this example scenario, two files were returned for both "coffee" and "cup of joe."

已展開 Coffee

已展開 Cup

另請參閱See also

概念Concepts

在 SharePoint Server 中建立及部署同義字Create and deploy a thesaurus in SharePoint Server