Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Nori 플러그인 설치 & Index 설정
- #### Versions
- - ES 6.6.2
- **1. 플러그인 설치**
- ```
- $ /$ES_HOME/bin/elasticsearch-plugin install analysis-nori
- ```
- ※ 삭제 시
- ```
- $ /$ES_HOME/bin/elasticsearch-plugin remove analysis-nori
- ```
- **2. 사용자 사전 추가**
- ```
- $ touch /$ES_HOME/config/userdict_ko.txt
- ```
- **3. Index 설정 & 매핑**
- ```json
- PUT nori_test
- {
- "settings" : {
- "index" : {
- "codec" : "best_compression",
- "refresh_interval" : "5s",
- "number_of_shards" : "2",
- "number_of_replicas" : "1",
- "analysis" : {
- "filter" : {
- "npos_filter" : {
- "type" : "nori_part_of_speech",
- "stoptags" : [
- "E",
- "IC",
- "J",
- "MAG",
- "MM",
- "SP",
- "SSC",
- "SSO",
- "SC",
- "SE",
- "XPN",
- "XSA",
- "XSN",
- "XSV",
- "UNA",
- "NA",
- "VSV"
- ]
- }
- },
- "analyzer" : {
- "korean" : {
- "filter" : [
- "npos_filter",
- "nori_readingform",
- "lowercase"
- ],
- "tokenizer" : "nori_user_dict"
- }
- },
- "tokenizer" : {
- "nori_user_dict" : {
- "mode" : "MIXED",
- "type" : "nori_tokenizer",
- "user_dictionary" : "userdict_ko.txt"
- }
- }
- }
- }
- },
- "mappings" : {
- "doc" : {
- "properties" : {
- "title" : {
- "type" : "text",
- "analyzer" : "korean",
- "copy_to" : "full_search",
- "fields" : {
- "keyword" : {
- "type" : "keyword",
- "ignore_above" : 256
- }
- }
- },
- "content" : {
- "type" : "text",
- "analyzer" : "korean",
- "copy_to" : "full_search",
- "fields" : {
- "keyword" : {
- "type" : "keyword",
- "ignore_above" : 256
- }
- }
- },
- "full_search" : {
- "type" : "text",
- "analyzer" : "korean"
- }
- }
- }
- }
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement