共用方式為


Indexes - Analyze

顯示分析器如何將文字分成標記。

POST {endpoint}/indexes('{indexName}')/search.analyze?api-version=2023-11-01

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string

搜尋服務的端點 URL。

indexName
path True

string

要測試分析器之索引的名稱。

api-version
query True

string

用戶端 API 版本。

要求標頭

名稱 必要 類型 Description
x-ms-client-request-id

string

uuid

使用要求傳送的追蹤標識碼,以協助偵錯。

要求本文

名稱 必要 類型 Description
text True

string

要分成令牌的文字。

analyzer

LexicalAnalyzerName

要用來中斷指定文字的分析器名稱。 如果未指定此參數,您必須改為指定Tokenizer。 Tokenizer 和分析器參數互斥。

charFilters

CharFilterName[]

中斷指定文字時要使用的選擇性字元篩選清單。 只有在使用 Tokenizer 參數時,才可以設定此參數。

tokenFilters

TokenFilterName[]

中斷指定文字時要使用的選擇性令牌篩選清單。 只有在使用 Tokenizer 參數時,才可以設定此參數。

tokenizer

LexicalTokenizerName

要用來中斷指定文字的Tokenizer名稱。 如果未指定此參數,您必須改為指定分析器。 Tokenizer 和分析器參數互斥。

回應

名稱 類型 Description
200 OK

AnalyzeResult

Other Status Codes

SearchError

錯誤回應。

範例

SearchServiceIndexAnalyze

Sample Request

POST https://myservice.search.windows.net/indexes('hotels')/search.analyze?api-version=2023-11-01

{
  "text": "Text to analyze",
  "analyzer": "standard.lucene"
}

Sample Response

{
  "tokens": [
    {
      "token": "text",
      "startOffset": 0,
      "endOffset": 4,
      "position": 0
    },
    {
      "token": "to",
      "startOffset": 5,
      "endOffset": 7,
      "position": 1
    },
    {
      "token": "analyze",
      "startOffset": 8,
      "endOffset": 15,
      "position": 2
    }
  ]
}

定義

名稱 Description
AnalyzedTokenInfo

分析器所傳回之令牌的相關信息。

AnalyzeRequest

指定一些用來將該文字分成標記的文字和分析元件。

AnalyzeResult

在文字上測試分析器的結果。

CharFilterName

定義搜尋引擎支援的所有字元篩選名稱。

LexicalAnalyzerName

定義搜尋引擎所支援之所有文字分析器的名稱。

LexicalTokenizerName

定義搜尋引擎所支援之所有 Tokenizer 的名稱。

SearchError

描述 API 的錯誤狀況。

TokenFilterName

定義搜尋引擎所支援之所有令牌篩選的名稱。

AnalyzedTokenInfo

分析器所傳回之令牌的相關信息。

名稱 類型 Description
endOffset

integer

輸入文字中標記最後一個字元的索引。

position

integer

標記相對於其他標記的輸入文字中的位置。 輸入文字中的第一個標記具有位置 0、下一個標記的位置 1 等等。 視所使用的分析器而定,某些令牌的位置可能相同,例如,如果它們彼此同義。

startOffset

integer

輸入文字中標記第一個字元的索引。

token

string

分析器傳回的令牌。

AnalyzeRequest

指定一些用來將該文字分成標記的文字和分析元件。

名稱 類型 Description
analyzer

LexicalAnalyzerName

要用來中斷指定文字的分析器名稱。 如果未指定此參數,您必須改為指定Tokenizer。 Tokenizer 和分析器參數互斥。

charFilters

CharFilterName[]

中斷指定文字時要使用的選擇性字元篩選清單。 只有在使用 Tokenizer 參數時,才可以設定此參數。

text

string

要分成令牌的文字。

tokenFilters

TokenFilterName[]

中斷指定文字時要使用的選擇性令牌篩選清單。 只有在使用 Tokenizer 參數時,才可以設定此參數。

tokenizer

LexicalTokenizerName

要用來中斷指定文字的Tokenizer名稱。 如果未指定此參數,您必須改為指定分析器。 Tokenizer 和分析器參數互斥。

AnalyzeResult

在文字上測試分析器的結果。

名稱 類型 Description
tokens

AnalyzedTokenInfo[]

要求中指定的分析器所傳回的令牌清單。

CharFilterName

定義搜尋引擎支援的所有字元篩選名稱。

名稱 類型 Description
html_strip

string

嘗試移除 HTML 建構的字元篩選。 請參閱 https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html

LexicalAnalyzerName

定義搜尋引擎所支援之所有文字分析器的名稱。

名稱 類型 Description
ar.lucene

string

阿拉伯文的 Lucene 分析器。

ar.microsoft

string

適用於阿拉伯文的 Microsoft 分析器。

bg.lucene

string

適用於保加利亞文的 Lucene 分析器。

bg.microsoft

string

適用於保加利亞文的 Microsoft 分析器。

bn.microsoft

string

適用於孟加拉國文的 Microsoft 分析器。

ca.lucene

string

卡達尼亞文的 Lucene 分析器。

ca.microsoft

string

適用於卡達尼亞文的 Microsoft 分析器。

cs.lucene

string

適用於捷克文的 Lucene 分析器。

cs.microsoft

string

適用於捷克文的 Microsoft 分析器。

da.lucene

string

丹麥文的 Lucene 分析器。

da.microsoft

string

丹麥文的 Microsoft 分析器。

de.lucene

string

德文的 Lucene 分析器。

de.microsoft

string

適用於德文的 Microsoft 分析器。

el.lucene

string

希臘文的 Lucene 分析器。

el.microsoft

string

適用於希臘文的 Microsoft 分析器。

en.lucene

string

適用於英文的 Lucene 分析器。

en.microsoft

string

適用於英文的 Microsoft 分析器。

es.lucene

string

西班牙文的 Lucene 分析器。

es.microsoft

string

適用於西班牙文的 Microsoft 分析器。

et.microsoft

string

適用於愛沙尼亞文的 Microsoft 分析器。

eu.lucene

string

Basque 的 Lucene 分析器。

fa.lucene

string

適用於波斯文的 Lucene 分析器。

fi.lucene

string

芬蘭文的 Lucene 分析器。

fi.microsoft

string

適用於芬蘭文的 Microsoft 分析器。

fr.lucene

string

法文的 Lucene 分析器。

fr.microsoft

string

適用於法文的 Microsoft 分析器。

ga.lucene

string

適用於愛爾蘭的 Lucene 分析器。

gl.lucene

string

Galician 的 Lucene 分析器。

gu.microsoft

string

適用於 Gujarati 的 Microsoft 分析器。

he.microsoft

string

希伯來文的 Microsoft 分析器。

hi.lucene

string

適用於印度文的 Lucene 分析器。

hi.microsoft

string

適用於印度文的 Microsoft 分析器。

hr.microsoft

string

適用於克羅埃西亞的 Microsoft 分析器。

hu.lucene

string

適用於匈牙利文的 Lucene 分析器。

hu.microsoft

string

適用於匈牙利文的 Microsoft 分析器。

hy.lucene

string

適用於亞美尼亞文的 Lucene 分析器。

id.lucene

string

適用於印尼文的 Lucene 分析器。

id.microsoft

string

適用於印尼文的 Microsoft 分析器 (Bahasa) 。

is.microsoft

string

適用於挪威文的 Microsoft 分析器。

it.lucene

string

義大利文的 Lucene 分析器。

it.microsoft

string

義大利文的 Microsoft 分析器。

ja.lucene

string

適用於日文的 Lucene 分析器。

ja.microsoft

string

適用於日文的 Microsoft 分析器。

keyword

string

將欄位的整個內容視為單一語彙基元。 這適合用於郵遞區號、識別碼和產品名稱等資料。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordAnalyzer.html

kn.microsoft

string

適用於 Kannada 的 Microsoft 分析器。

ko.lucene

string

韓文的 Lucene 分析器。

ko.microsoft

string

適用於韓文的 Microsoft 分析器。

lt.microsoft

string

適用於立陶宛文的 Microsoft 分析器。

lv.lucene

string

適用於義大利文的 Lucene 分析器。

lv.microsoft

string

適用於義大利文的 Microsoft 分析器。

ml.microsoft

string

Microsoft Analyzer for馬來亞蘭文。

mr.microsoft

string

適用於 Marathi 的 Microsoft 分析器。

ms.microsoft

string

Microsoft Analyzer for 馬來亞文 (拉丁) 。

nb.microsoft

string

適用於挪威文的 Microsoft 分析器 (Bokmål) 。

nl.lucene

string

荷蘭文的 Lucene 分析器。

nl.microsoft

string

荷蘭文的 Microsoft 分析器。

no.lucene

string

挪威文的 Lucene 分析器。

pa.microsoft

string

適用於 Punjabi 的 Microsoft 分析器。

pattern

string

透過規則運算式模式彈性地將文字分割成字詞。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html

pl.lucene

string

波蘭文的 Lucene 分析器。

pl.microsoft

string

適用於波蘭文的 Microsoft 分析器。

pt-BR.lucene

string

葡萄牙文 (巴西) Lucene 分析器。

pt-BR.microsoft

string

巴西) 葡萄牙文 (Microsoft 分析器。

pt-PT.lucene

string

葡萄牙文 (葡萄牙文) 的 Lucene 分析器。

pt-PT.microsoft

string

葡萄牙 (葡萄牙) 的 Microsoft 分析器。

ro.lucene

string

適用於羅馬尼亞文的 Lucene 分析器。

ro.microsoft

string

適用於羅馬尼亞文的 Microsoft 分析器。

ru.lucene

string

適用於俄文的 Lucene 分析器。

ru.microsoft

string

適用於俄文的 Microsoft 分析器。

simple

string

在非字母的位置分割文字,並將其轉換成小寫。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/SimpleAnalyzer.html

sk.microsoft

string

適用於斯洛伐克文的 Microsoft 分析器。

sl.microsoft

string

斯洛維尼亞文的 Microsoft 分析器。

sr-cyrillic.microsoft

string

適用於塞爾維亞文 (斯拉夫) 的 Microsoft 分析器。

sr-latin.microsoft

string

適用於塞爾維亞文 (拉丁) 的 Microsoft 分析器。

standard.lucene

string

標準 Lucene 分析器。

standardasciifolding.lucene

string

標準 ASCII 折疊 Lucene 分析器。 請參閱 https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#Analyzers

stop

string

以非字母分割文字;套用小寫和停用字詞標記篩選。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopAnalyzer.html

sv.lucene

string

瑞典文的 Lucene 分析器。

sv.microsoft

string

適用於瑞典文的 Microsoft 分析器。

ta.microsoft

string

適用於 Tamil 的 Microsoft 分析器。

te.microsoft

string

適用於 Telugu 的 Microsoft 分析器。

th.lucene

string

泰文的 Lucene 分析器。

th.microsoft

string

適用於泰文的 Microsoft 分析器。

tr.lucene

string

適用於土耳其文的 Lucene 分析器。

tr.microsoft

string

適用於土耳其文的 Microsoft 分析器。

uk.microsoft

string

適用於烏克蘭的 Microsoft 分析器。

ur.microsoft

string

適用於 Urdu 的 Microsoft 分析器。

vi.microsoft

string

適用於越南文的 Microsoft 分析器。

whitespace

string

使用 whitespace Token 化工具的分析器。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html

zh-Hans.lucene

string

適用於簡體中文 () 的 Lucene 分析器。

zh-Hans.microsoft

string

適用於簡體中文 () 的 Microsoft 分析器。

zh-Hant.lucene

string

適用於繁體中文 () 的 Lucene 分析器。

zh-Hant.microsoft

string

適用於繁體中文 () 的 Microsoft 分析器。

LexicalTokenizerName

定義搜尋引擎所支援之所有 Tokenizer 的名稱。

名稱 類型 Description
classic

string

適用於處理大部分歐洲語言檔的文法型Tokenizer。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicTokenizer.html

edgeNGram

string

將邊緣的輸入令牌化為指定大小 (s) 的 n-gram。 請參閱 https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html

keyword_v2

string

以單一語彙基元的形式發出整個輸入。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordTokenizer.html

letter

string

在非字母的位置上分割文字。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LetterTokenizer.html

lowercase

string

在非字母的位置分割文字,並將其轉換成小寫。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html

microsoft_language_stemming_tokenizer

string

使用語言特有的規則來分割文字,並將字組縮減到其基本形式。

microsoft_language_tokenizer

string

使用語言特有的規則分割文字。

nGram

string

將輸入 Token 化到指定的 n-gram 大小。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenizer.html

path_hierarchy_v2

string

路徑類階層的 Token 化工具。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html

pattern

string

使用 regex 模式比對來建構不同令牌的 Tokenizer。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/pattern/PatternTokenizer.html

standard_v2

string

標準 Lucene 分析器;由標準 Tokenizer、小寫篩選和停止篩選所組成。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardTokenizer.html

uax_url_email

string

將 URL 和電子郵件 Token 化為一個語彙基元。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html

whitespace

string

在空白字元處分割文字。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html

SearchError

描述 API 的錯誤狀況。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

details

SearchError[]

導致此錯誤之特定錯誤的詳細數據陣列。

message

string

人類可讀取的錯誤表示法。

TokenFilterName

定義搜尋引擎所支援之所有令牌篩選的名稱。

名稱 類型 Description
apostrophe

string

去除單引號 (包括單引號本身) 之後的所有字元。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/tr/ApostropheFilter.html

arabic_normalization

string

套用阿拉伯文標準化程式的語彙基元篩選器,用來標準化正字法。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html

asciifolding

string

如果這類對等專案存在,則會將前 127 個 ASCII 字元中的字母、數值和符號 Unicode 字元轉換成其 ASCII 對等專案, (“Basic Latin” Unicode 區塊) 。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html

cjk_bigram

string

形成從標準Tokenizer產生的CJK詞彙 bigram。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html

cjk_width

string

標準化 CJK 寬度的差異。 將 fullwidth ASCII 變體折迭成對等的基本拉丁,並將半角片假名變體折疊成對等的 Kana。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html

classic

string

拿掉英文擁有者,以及縮略字中的點。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicFilter.html

common_grams

string

在編製索引時,建構常用字詞的雙字母組。 仍會編製單個字詞的索引,並與雙字母組重疊。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html

edgeNGram_v2

string

從輸入令牌的前端或後端開始,產生指定大小的 n-gram (s) 。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html

elision

string

移除元音省略。 例如,“l'avion” (平面) 將會轉換成 “avion” (平面) 。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html

german_normalization

string

根據德文2 雪球演算法的啟發學習法將德文字元正規化。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html

hindi_normalization

string

標準化印度文字,以移除拼字變化的一些差異。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html

indic_normalization

string

標準化印度語文字的 Unicode 表示法。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html

keyword_repeat

string

發出每個傳入令牌兩次,一次作為關鍵詞,一次做為非關鍵詞。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html

kstem

string

適用於英文的高效能 kstem 篩選。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/en/KStemFilter.html

length

string

移除太長或太短的文字。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html

limit

string

限制編製索引時的語彙基元數目。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html

lowercase

string

將語彙基元文字標準化為小寫。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.htm

nGram_v2

string

產生指定大小的 n-gram。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html

persian_normalization

string

對波斯文套用標準化。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html

phonetic

string

建立語音相符項目的語彙基元。 請參閱 https://lucene.apache.org/core/4_10_3/analyzers-phonetic/org/apache/lucene/analysis/phonetic/package-tree.html

porter_stem

string

使用 Porter 字幹分析演算法來轉換令牌數據流。 請參閱 http://tartarus.org/~martin/PorterStemmer

reverse

string

反轉語彙基元字串。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html

scandinavian_folding

string

折疊斯堪的納維亞字元,åÅäæÄÆ->a 及 öÖøØ->o。 其也可以區分雙母音 aa、ae、ao、oe 和 oo 的使用,並且只保留第一個。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html

scandinavian_normalization

string

標準化可交換的斯堪的納維亞字元用法。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html

shingle

string

將語彙基元的組合建立為單一語彙基元。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html

snowball

string

使用 Snowball 產生的字幹分析器來建立字組的篩選。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/snowball/SnowballFilter.html

sorani_normalization

string

標準化索拉尼 (Sorani) 文字的 Unicode 表示法。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html

stemmer

string

語言特定字幹分析篩選器。 請參閱 https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters

stopwords

string

從語彙基元資料流移除停用字詞。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html

trim

string

修剪語彙基元的開頭及結尾空白字元。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html

truncate

string

將詞彙截斷為特定長度。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html

unique

string

篩選出與前一個語彙基元使用相同文字的語彙基元。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html

uppercase

string

將語彙基元文字標準化為大寫。 請參閱 http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html

word_delimiter

string

將字組分割成部分字組,並對部分字組群組執行選擇性的轉換。