참조 : http://c.tistory.com/243
PUT /cine21
{
"settings": {
"analysis": {
"analyzer": {
"korean_analyzer" : {
"type" : "custom",
"tokenizer": "korean_tokenizer",
"filter" : ["stop", "lowercase", "trim", "synonym"]
},
"ngram_analyzer" : {
"type" : "custom",
"tokenizer" : "ngram_tokenizer",
"filter" : ["lowercase", "trim","synonym"]
},
"edge_ngram_analyzer" : {
"type" : "custom",
"tokenizer" : "edge_ngram_tokenizer",
"filter" : ["lowercase", "trim","synonym"]
}
},
"tokenizer": {
"korean_tokenizer": {
"type": "mecab_ko_standard_tokenizer",
"compound_noun_min_length": 100
},
"ngram_tokenizer" : {
"type" : "nGram",
"min_gram" : "1",
"max_gram" : "5",
"token_chars": [ "letter", "digit", "punctuation", "symbol" ]
},
"edge_ngram_tokenizer" : {
"type" : "edgeNGram",
"min_gram" : "1",
"max_gram" : "5",
"token_chars": [ "letter", "digit", "punctuation", "symbol" ]
}
},
"filter": {
"synonym" : {
"type" : "synonym",
"synonyms" : [
"탐, 톰",
"플래이어, 플레이어"
]
}
}
}
},
"mappings": {
"movie" : {
"analyzer" : "korean_analyzer",
"index_analyzer" : "edge_ngram_analyzer",
"search_analyzer" : "edge_ngram_analyzer",
"properties": {
"title" : {
"type": "string",
"fields" : {
"h_pf" : {"type" : "string", "store" : "no", "index" : "not_analyzed", "omit_norms" : true, "index_options" : "offsets", "term_vector" : "with_positions_offsets", "include_in_all" : false, "boost": 20},
"h_ko" : {"type" : "string", "index_analyzer" : "korean_analyzer", "boost": 3},
"h_ng" : {"type" : "string", "index_analyzer" : "ngram_analyzer", "boost": 1},
"h_ed" : {"type" : "string", "index_analyzer" : "edge_ngram_analyzer", "boost": 2}
}
}
}
}
}
}
GET /cine21/_search
GET /cine21/_search
{
"query": {
"bool": {
"should": [
{"prefix": {
"title.h_pf": "창"
}},{"term": {
"title.h_ko": "창"
}},{"term": {
"title.h_ed": "창"
}},{"term": {
"title.h_ng": "창"
}}
],
"minimum_should_match": 1
}
}
}
출처: http://c.tistory.com/243 [coens TISTORY]
출처: http://c.tistory.com/243 [coens TISTORY]
출처: http://c.tistory.com/243 [coens TISTORY]
'검색엔진' 카테고리의 다른 글
logstash - window 포트 죽이기 (0) | 2017.12.27 |
---|---|
벌크로 제이슨 파일 넣기 (0) | 2017.12.02 |
11.[Elasticsearch]/[ELK]. mecab 설치 (은전한닢), 윈도우 설치 [수정중 ...] (0) | 2017.11.06 |
mecab 설치 (0) | 2017.10.23 |
10.[Elasticsearch]/[ELK]. SCORE 검색 점수 (0) | 2017.10.20 |