$ sh gradlew clean build buildPluginZip
bin/elasticsearch-plugin install https://github.com/netcrazy/elasticsearch-jaso-analyzer/releases/download/v7.16.2/jaso-analyzer-plugin-7.16.2-plugin.zip
bin/elasticsearch-plugin remove jaso-analyzer
curl -XDELETE 'http://localhost:9200/jaso'
curl -XPUT -H 'Content-Type: application/json' 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 -H 'Content-Type: application/json' http://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 -H 'Content-Type: application/json' http://localhost:9200/jaso/_mapping/test -d '{
"properties": {
"name": {
"type": "text",
"store": true,
"analyzer": "suggest_index_analyzer",
"search_analyzer": "suggest_search_analyzer"
}
}
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/_analyze?pretty=true -d '{
"analyzer" : "suggest_index_analyzer",
"text" : "최일규 Hello"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/_analyze?pretty=true -d '{
"analyzer" : "suggest_search_analyzer",
"text" : "쵱"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/test?pretty=true -d '{
"name":"최일규 Hello"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/test?pretty=true -d '{
"name":"초아"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/test/_search?pretty=true -d '{
"query" : {
"match" : { "name" : "초" }
}
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/test/_search?pretty=true -d '{
"query" : {
"match" : { "name" : "ㅊㅇㄱ" }
}
}'