cd /path/to/{ES_HOME}
sudo bin/elasticsearch-plugin install analysis-nori
# remove plugin
sudo bin/elasticsearch-plugin remove analysis-nori
curl -X PUT "localhost:9200/nori_sample" -H 'Content-Type: application/json' -d'
{
"settings": {
"index": {
"analysis": {
"tokenizer": {
"nori_user_dict": {
"type": "nori_tokenizer",
"decompound_mode": "mixed",
"user_dictionary": "userdict_ko.txt"
}
},
"analyzer": {
"my_analyzer": {
"type": "custom",
"tokenizer": "nori_user_dict"
}
}
}
}
}
}
'
curl -X GET "localhost:9200/nori_sample/_analyze" -H 'Content-Type: application/json' -d'
{
"analyzer": "my_analyzer",
"text": "세종시"
}
'
curl -X DELETE "localhost:9200/nori_sample"
curl -X PUT "localhost:9200/nori_sample" -H 'Content-Type: application/json' -d'
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "nori_tokenizer",
"filter": [
"my_posfilter"
]
}
},
"filter": {
"my_posfilter": {
"type": "nori_part_of_speech",
"stoptags": [
"NR"
]
}
}
}
}
}
}
'
curl -X GET "localhost:9200/nori_sample/_analyze" -H 'Content-Type: application/json' -d'
{
"analyzer": "my_analyzer",
"text": "여섯 용이"
}
'