Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. # Nori 플러그인 설치 & Index 설정
  2.  
  3. #### Versions
  4. - ES 6.6.2
  5.  
  6. **1. 플러그인 설치**
  7. ```
  8. $ /$ES_HOME/bin/elasticsearch-plugin install analysis-nori
  9. ```
  10. ※ 삭제 시
  11. ```
  12. $ /$ES_HOME/bin/elasticsearch-plugin remove analysis-nori
  13. ```
  14.  
  15. **2. 사용자 사전 추가**
  16. ```
  17. $ touch /$ES_HOME/config/userdict_ko.txt
  18. ```
  19.  
  20. **3. Index 설정 & 매핑**
  21. ```json
  22. PUT nori_test
  23. {
  24. "settings" : {
  25. "index" : {
  26. "codec" : "best_compression",
  27. "refresh_interval" : "5s",
  28. "number_of_shards" : "2",
  29. "number_of_replicas" : "1",
  30. "analysis" : {
  31. "filter" : {
  32. "npos_filter" : {
  33. "type" : "nori_part_of_speech",
  34. "stoptags" : [
  35. "E",
  36. "IC",
  37. "J",
  38. "MAG",
  39. "MM",
  40. "SP",
  41. "SSC",
  42. "SSO",
  43. "SC",
  44. "SE",
  45. "XPN",
  46. "XSA",
  47. "XSN",
  48. "XSV",
  49. "UNA",
  50. "NA",
  51. "VSV"
  52. ]
  53. }
  54. },
  55. "analyzer" : {
  56. "korean" : {
  57. "filter" : [
  58. "npos_filter",
  59. "nori_readingform",
  60. "lowercase"
  61. ],
  62. "tokenizer" : "nori_user_dict"
  63. }
  64. },
  65. "tokenizer" : {
  66. "nori_user_dict" : {
  67. "mode" : "MIXED",
  68. "type" : "nori_tokenizer",
  69. "user_dictionary" : "userdict_ko.txt"
  70. }
  71. }
  72. }
  73. }
  74. },
  75. "mappings" : {
  76. "doc" : {
  77. "properties" : {
  78. "title" : {
  79. "type" : "text",
  80. "analyzer" : "korean",
  81. "copy_to" : "full_search",
  82. "fields" : {
  83. "keyword" : {
  84. "type" : "keyword",
  85. "ignore_above" : 256
  86. }
  87. }
  88. },
  89. "content" : {
  90. "type" : "text",
  91. "analyzer" : "korean",
  92. "copy_to" : "full_search",
  93. "fields" : {
  94. "keyword" : {
  95. "type" : "keyword",
  96. "ignore_above" : 256
  97. }
  98. }
  99. },
  100. "full_search" : {
  101. "type" : "text",
  102. "analyzer" : "korean"
  103. }
  104. }
  105. }
  106. }
  107. }
  108. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement