接口描述
對輸入的內容進行分詞
請求方式只接受【GET】請求
http://localhost:port/index/_analyze?analyzer=ik&pretty=true&text=湖南省氣象信息中心湖南省省內氣象廣域網絡系統建設項目公開招標
#### 具體地址單獨給出 TEXT內容改變外,其它保持不變
請求參數說明
json數據格式,具體內容如下
| 參數 | 類型 | 說明 |
|---|---|---|
| text | string | 要搜索的內容 |
------------------- 分隔線 ---------------
返回參數說明
| 參數 | 類型 | 說明 |
|---|---|---|
| token | String | 分詞結果 |
返回結果
{
tokens: [
{
token: "湖南省",
start_offset: 0,
end_offset: 3,
type: "CN_WORD",
position: 1
},
{
token: "氣象",
start_offset: 3,
end_offset: 5,
type: "CN_WORD",
position: 2
},
{
token: "信息中心",
start_offset: 5,
end_offset: 9,
type: "CN_WORD",
position: 3
},
{
token: "湖南省",
start_offset: 9,
end_offset: 12,
type: "CN_WORD",
position: 4
},
{
token: "省內",
start_offset: 12,
end_offset: 14,
type: "CN_WORD",
position: 5
},
{
token: "氣象",
start_offset: 14,
end_offset: 16,
type: "CN_WORD",
position: 6
},
{
token: "廣域",
start_offset: 16,
end_offset: 18,
type: "CN_WORD",
position: 7
},
{
token: "網",
start_offset: 28,
end_offset: 29,
type: "CN_CHAR",
position: 8
},
{
token: "絡",
start_offset: 44,
end_offset: 45,
type: "CN_WORD",
position: 9
},
{
token: "系統",
start_offset: 66,
end_offset: 68,
type: "CN_WORD",
position: 10
},
{
token: "建設項目",
start_offset: 68,
end_offset: 72,
type: "CN_WORD",
position: 11
},
{
token: "公開招標",
start_offset: 72,
end_offset: 76,
type: "CN_WORD",
position: 12
}
]
}