Korean nori-analysis plugin not working on searching


(HJ, Lee) #1

Hi. this is my setting
settings = { "settings": { "index": { "analysis": { "tokenizer": { "nori_user_dict": { "type": "nori_tokenizer", "decompound_mode": "mixed", "user_dictionary": "userdict_ko.txt" } }, "analyzer": { "korean": { "type": "custom", "tokenizer": "nori_user_dict" } } } } } }

and i did this analyze query

`curl -X GET "localhost:9200/scene_talk/_analyze?pretty=true" -H 'Content-Type: application/json' -d'

{
"analyzer": "korean",
"text": "아버지가 방에 들어가신다."
}
'`

this is return value
{ "tokens" : [ { "token" : "아버지", "start_offset" : 0, "end_offset" : 3, "type" : "word", "position" : 0 }, { "token" : "가", "start_offset" : 3, "end_offset" : 4, "type" : "word", "position" : 1 }, { "token" : "방", "start_offset" : 5, "end_offset" : 6, "type" : "word", "position" : 2 }, { "token" : "에", "start_offset" : 6, "end_offset" : 7, "type" : "word", "position" : 3 }, { "token" : "들어가", "start_offset" : 8, "end_offset" : 11, "type" : "word", "position" : 4 }, { "token" : "신다", "start_offset" : 11, "end_offset" : 13, "type" : "word", "position" : 5, "positionLength" : 2 }, { "token" : "시", "start_offset" : 11, "end_offset" : 13, "type" : "word", "position" : 5 }, { "token" : "ᆫ다", "start_offset" : 11, "end_offset" : 13, "type" : "word", "position" : 6 } ] }

however, when i shoot the search query, analyzer does not working....

`GET /scene_talk/_search

{
"query": {
"match": {"txt": "아버지"}
}
}`

How can i fix this ? help me plz...


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.