IK分词插件是不是要两步?第一步获取所有词汇,第二步所有分词and查询?

是不是我把IK分词器想的太智能了?我以为是直接传整条字符串,然后ES会分词+搜索一步完成

  • 分词查询
    {
      "analyzer": "ik_max_word",
      "text": "今天天气真的不错,非常适合出游"
    }
  • 结果
    {
      "tokens": [
          {
              "token": "今天天气",
              "start_offset": 0,
              "end_offset": 4,
              "type": "CN_WORD",
              "position": 0
          },
          {
              "token": "今天",
              "start_offset": 0,
              "end_offset": 2,
              "type": "CN_WORD",
              "position": 1
          },
          {
              "token": "天天",
              "start_offset": 1,
              "end_offset": 3,
              "type": "CN_WORD",
              "position": 2
          },
          {
              "token": "天气",
              "start_offset": 2,
              "end_offset": 4,
              "type": "CN_WORD",
              "position": 3
          },
          {
              "token": "真的",
              "start_offset": 4,
              "end_offset": 6,
              "type": "CN_WORD",
              "position": 4
          },
          {
              "token": "不错",
              "start_offset": 6,
              "end_offset": 8,
              "type": "CN_WORD",
              "position": 5
          },
          {
              "token": "非常",
              "start_offset": 9,
              "end_offset": 11,
              "type": "CN_WORD",
              "position": 6
          },
          {
              "token": "适合",
              "start_offset": 11,
              "end_offset": 13,
              "type": "CN_WORD",
              "position": 7
          },
          {
              "token": "合出",
              "start_offset": 12,
              "end_offset": 14,
              "type": "CN_WORD",
              "position": 8
          },
          {
              "token": "出游",
              "start_offset": 13,
              "end_offset": 15,
              "type": "CN_WORD",
              "position": 9
          }
      ]
    }
IK
讨论数量: 2

match,match_phrase、wildcard

1周前 评论
勇敢的心 (楼主) 1周前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!