- AbstractPlugin => Plugin
- [plugin-descriptor.properties] (https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html#plugin-authors) 프로퍼타 파일 형식 변경
*https://github.com/imotov/elasticsearch-native-script-example
- ES 1.7x -> 2.3.1
$ gradle build buildPluginZip
sudo ./bin/plugin install https://github.com/netcrazy/elasticsearch-jaso-analyzer/releases/download/1.0.2/jaso-analyzer-plugin-1.0.2-plugin.zip
sudo bin/plugin remove jaso-analyzer
curl -XDELETE 'http://localhost:9200/jaso'
curl -XPUT localhost:9200/jaso/ -d '{
"settings": {
"index": {
"analysis": {
"filter": {
"suggest_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 50
}
},
"analyzer": {
"suggest_search_analyzer": {
"type": "custom",
"tokenizer": "jaso_tokenizer"
},
"suggest_index_analyzer": {
"type": "custom",
"tokenizer": "jaso_tokenizer",
"filter": [
"suggest_filter"
]
}
}
}
}
}
}'
curl -XPUT localhost:9200/jaso/ -d '{
"settings": {
"index": {
"analysis": {
"filter": {
"suggest_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 50
}
},
"tokenizer": {
"jaso_search_tokenizer": {
"type": "jaso_tokenizer",
"mistype": true,
"chosung": false
},
"jaso_index_tokenizer": {
"type": "jaso_tokenizer",
"mistype": true,
"chosung": true
}
},
"analyzer": {
"suggest_search_analyzer": {
"type": "custom",
"tokenizer": "jaso_search_tokenizer"
},
"suggest_index_analyzer": {
"type": "custom",
"tokenizer": "jaso_index_tokenizer",
"filter": [
"suggest_filter"
]
}
}
}
}
}
}'
curl -XPUT 'http://localhost:9200/jaso/_mapping/test' -d '{
"properties": {
"name": {
"type": "string",
"store": true,
"analyzer": "suggest_index_analyzer",
"search_analyzer": "suggest_search_analyzer"
}
}
}'
curl -XGET 'localhost:9200/jaso/_analyze?analyzer=suggest_index_analyzer&pretty' -d '최일규 Hello'
curl -XGET 'localhost:9200/jaso/_analyze?analyzer=suggest_search_analyzer&pretty' -d '최일규 Hello'
curl -XPOST http://localhost:9200/jaso/test/ -d '{
"name":"최일규 Hello"
}'
curl -XPOST http://localhost:9200/jaso/test/ -d '{
"name":"초아"
}'
curl -XPOST 'http://localhost:9200/jaso/test/_search?pretty' -d '{
"query" : {
"match" : { "name" : "초" }
}
}'
curl -XPOST 'http://localhost:9200/jaso/test/_search?pretty' -d '{
"query" : {
"match" : { "name" : "ㅊㅇㄱ" }
}
}'