1.ダウンロードしelasticsearch分析-IK-5.6.8
- ここでは、バージョンESに一致しています。
- 推奨githubのダウンロードhttps://github.com/medcl/elasticsearch-analysis-ik/releases?after=v5.6.14
- ダウンロードエキスは、コンテンツの内側には、次のディレクトリの下に、に固執IK-アナライザと呼ばれる新しいフォルダを作成し、そこに内容をコピーします。
図2に示すように、2つのワードが提供され
- IK-スマートセグメンテーションに起こりました
{
"tokens": [
{
"token": "我",
"start_offset": 0,
"end_offset": 1,
"type": "CN_CHAR",
"position": 0
},
{
"token": "是",
"start_offset": 1,
"end_offset": 2,
"type": "CN_CHAR",
"position": 1
},
{
"token": "河北",
"start_offset": 2,
"end_offset": 4,
"type": "CN_WORD",
"position": 2
},
{
"token": "大学",
"start_offset": 4,
"end_offset": 6,
"type": "CN_WORD",
"position": 3
},
{
"token": "青年",
"start_offset": 6,
"end_offset": 8,
"type": "CN_WORD",
"position": 4
}
]
}
- 最もきめ細かい部門
{
"tokens": [
{
"token": "我",
"start_offset": 0,
"end_offset": 1,
"type": "CN_CHAR",
"position": 0
},
{
"token": "是",
"start_offset": 1,
"end_offset": 2,
"type": "CN_CHAR",
"position": 1
},
{
"token": "河北",
"start_offset": 2,
"end_offset": 4,
"type": "CN_WORD",
"position": 2
},
{
"token": "北大",
"start_offset": 3,
"end_offset": 5,
"type": "CN_WORD",
"position": 3
},
{
"token": "大学",
"start_offset": 4,
"end_offset": 6,
"type": "CN_WORD",
"position": 4
},
{
"token": "青年",
"start_offset": 6,
"end_offset": 8,
"type": "CN_WORD",
"position": 5
}
]
}
3、IK-スマートトークナイザを使用して
{
"mappings":{
"hello":{
"properties":{
"id":{
"type":"long",
"store":true
},
"title":{
"type":"text",
"store":true,
"analyzer":"ik_smart"
},
"content":{
"type":"text",
"store":true,
"analyzer":"ik_smart"
}
}
}
}
}
- 終了指定されたワードが使用できるようになりました。
4、構造のクラスタ
クラスタを作成します。
- そして、複数のサーバ上でESが構築することができます。また、それは、サーバー上に複数のESを開くことができます。あなただけコピーして貼り付けることができます。
- データファイルはコピーした後に削除されます。
- 設定ファイル(コンフィギュレーション最初elaticsearch.yml)を変更します。
cluster.name: my-elasticsearch
node.name: node-1
network.host: 127.0.0.1
http.port: 9201
transport.tcp.port: 9301
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9301","127.0.0.1:9302","127.0.0.1:9303"]
- ターンnode.nameにおけるES後、たhttp.port、transport.tcp.portそれを修正します。
- ここでは3つのクラスタがあります。