(자동완성 플러그인)
🔗 Original Project: netcrazy/elasticsearch-jaso-analyzer
📝 Original Author: Choi ilkyu (최일규)
🔄 This Fork: Updated for Elasticsearch 9.0.3 compatibility with Java 21+ support
$ ./gradlew clean build buildPluginZip# 플러그인 ZIP 파일을 다운로드 후
/usr/share/elasticsearch/bin/elasticsearch-plugin install file:///path/to/jaso-analyzer-plugin-9.0.3-plugin.zip# GitHub Releases에서 직접 설치 (릴리스 후 사용 가능)
/usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/YOUR_USERNAME/elasticsearch-jaso-analyzer/releases/download/v9.0.3/jaso-analyzer-plugin-9.0.3-plugin.zip#플러그인이 자동으로 설치된다.
cd docker
docker-compose up -d
bin/elasticsearch-plugin install https://github.com/netcrazy/elasticsearch-jaso-analyzer/releases/download/v8.6.2/jaso-analyzer-plugin-8.6.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 -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/_doc?pretty=true -d '{
"name":"최일규 Hello"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/_doc?pretty=true -d '{
"name":"초아"
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/_search?pretty=true -d '{
"query" : {
"match" : { "name" : "초" }
}
}'
curl -XPOST -H 'Content-Type: application/json' http://localhost:9200/jaso/_search?pretty=true -d '{
"query" : {
"match" : { "name" : "ㅊㅇㄱ" }
}
}'
# 모든 테스트 실행
./gradlew test
# 특정 테스트 클래스 실행
./gradlew test --tests "org.elasticsearch.analysis.JasoTest"
./gradlew test --tests "org.elasticsearch.analysis.JasoTokenizerTest"
# 테스트 리포트 확인
open build/reports/tests/test/index.html현재 다음 기능들이 테스트됩니다:
- ✅ 자소 분해 기능 (
JasoTest) - ✅ 토크나이저 기능 (
JasoTokenizerTest) - ✅ 한영 오타 처리
- ✅ 초성 검색 토큰 생성
- ✅ 공백 및 특수문자 처리
- CI/CD: 푸시/PR 시 자동 테스트 실행 (Java 21, 23)
- 릴리스: 릴리스 전 자동 테스트 검증
- 커버리지: 테스트 결과 리포트 자동 생성
# 코드 커밋 및 푸시
git add .
git commit -m "Update to Elasticsearch 9.0.3"
git push origin main
# 태그 생성 및 푸시 (자동 릴리스 트리거)
git tag v9.0.3
git push origin v9.0.3- GitHub 저장소에서 "Releases" 페이지로 이동
- "Create a new release" 클릭
- 태그:
v9.0.3, 제목:Elasticsearch 9.0.3 지원 build/distributions/jaso-analyzer-plugin-9.0.3-plugin.zip파일 업로드- "Publish release" 클릭
# GitHub Releases에서 설치
/usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/YOUR_USERNAME/elasticsearch-jaso-analyzer/releases/download/v9.0.3/jaso-analyzer-plugin-9.0.3-plugin.zip
# 설치 확인
/usr/share/elasticsearch/bin/elasticsearch-plugin list
# Elasticsearch 재시작 필요
sudo systemctl restart elasticsearchcd docker
docker-compose up -d
# 플러그인 설치 확인
curl -X GET "localhost:9200/_nodes/plugins?pretty"/usr/share/elasticsearch/bin/elasticsearch-plugin remove jaso-analyzer
sudo systemctl restart elasticsearch이 프로젝트는 MIT 라이센스 하에 배포됩니다.
- 저장소: netcrazy/elasticsearch-jaso-analyzer
- 원 저작자: Choi ilkyu (최일규)
- 최초 버전: Elasticsearch 8.6.2 지원
- Elasticsearch 9.0.3 호환성 업데이트
- Java 21+ 지원 (Java 23에서 테스트됨)
- GitHub Actions CI/CD 추가
- 자동화된 릴리스 프로세스
- 향상된 테스트 커버리지
원본 프로젝트와 이 Fork 모두에 기여를 환영합니다. Pull Request를 보내주세요!