Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. - Đây là cách phân token của elastic cho tiếng nhật
  2. ````
  3. POST _analyze
  4. {
  5. "analyzer": "kuromoji",
  6. "text": "第23回冬季オリンピック大会は大韓民国江原道平昌で2018年2月9日から25日までの17日間、開催されます。大韓民国・平昌は三度の挑戦の末、2011年7月7日に開かれた第123回IOC総会で過半数票を獲得し、2018年冬季オリンピック及びパラリンピックの開催地に選ばれました。これにより1988年ソウルオリンピック開催後30年の時を経てついに、大韓民国で最初の冬季パラリンピックの舞台が繰り広げられます。平昌で開・閉会式とほぼ全ての雪上競技が開催され、江陵では氷上種目全競技が、そして旌善ではアルペンスキー滑降競技が開催される予定です。"
  7. }
  8. =>
  9. {
  10. "tokens": [
  11. {
  12. "token": "第",
  13. "start_offset": 0,
  14. "end_offset": 1,
  15. "type": "word",
  16. "position": 0
  17. },
  18. {
  19. "token": "23",
  20. "start_offset": 1,
  21. "end_offset": 3,
  22. "type": "word",
  23. "position": 1
  24. },
  25. {
  26. "token": "回",
  27. "start_offset": 3,
  28. "end_offset": 4,
  29. "type": "word",
  30. "position": 2
  31. },
  32. {
  33. "token": "冬季",
  34. "start_offset": 4,
  35. "end_offset": 6,
  36. "type": "word",
  37. "position": 3
  38. },
  39. {
  40. "token": "オリンピック",
  41. "start_offset": 6,
  42. "end_offset": 12,
  43. "type": "word",
  44. "position": 4
  45. },
  46. {
  47. "token": "大会",
  48. "start_offset": 12,
  49. "end_offset": 14,
  50. "type": "word",
  51. "position": 5
  52. },
  53. ...
  54. ````
  55. - nếu như họ muốn matching từ theo kiểu search like thì hầu như ko tận dụng được gì nhiều của elasticsearch cả a/c ạ (bow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement