开发者社区 > 云存储 > 正文

如下,请问表格存储这个分词结果从哪里获取呢?

TEXT类型索引列默认使用SingleWord分词器,按“单个汉字”切分中文,按“单个单词”切分英文,大小写字母不敏感,且单词不会被拆分为子词。例如,字段值"Xiaomi/小米redmi note 7 pro 红米索尼4800万智能手机"会被切分为词条:"xiaomi", "小", "米", "redmi", "note", "7", "pro", "红", "米", "索", "尼", "4800", "万", "智", "能", "手", "机",并建立倒排索引。 这个分词结果从哪里获取呢?

展开
收起
乐天香橙派 2024-01-18 13:27:51 28 0
2 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看

    这个分词结果可以通过Elasticsearch的API接口获取。具体来说,可以使用_analyze API对文本进行分词分析,并返回分词结果。例如:

    GET /my_index/_analyze
    {
      "text": "Xiaomi/小米redmi note 7 pro 红米索尼4800万智能手机",
      "analyzer": "singleword"
    }
    

    返回的结果类似于:

    ```
    {
    "tokens": [
    {
    "token": "xiaomi",
    "start_offset": 0,
    "end_offset": 5,
    "type": "word",
    "position": 1
    },
    {
    "token": "小",
    "start_offset": 6,
    "end_offset": 7,
    "type": "word",
    "position": 2
    },
    {
    "token": "米",
    "start_offset": 8,
    "end_offset": 9,
    "type": "word",
    "position": 3
    },
    {
    "token": "redmi",
    "start_offset": 10,
    "end_offset": 15,
    "type": "word",
    "position": 4
    },
    {
    "token": "note",
    "start_offset": 16,
    "end_offset": 18,
    "type": "word",
    "position": 5
    },
    {
    "token": "7",
    "start_offset": 19,
    "end_offset": 20,
    "type": "number",
    "position": 6
    },
    {
    "token": "pro",
    "start_offset": 21,
    "end_offset": 23,
    "type": "word",
    "position": 7
    },
    {
    "token": "红",
    "start_offset": 24,
    "end_offset": 25,
    "type": "word",
    "position": 8
    },
    {
    "token": "米",
    "start_offset": 26,
    "end_offset": 27,
    "type": "word",
    "position": 9
    },
    {
    "token": "索",
    "start_offset": 28,
    "end_offset": 29,
    "type": "word",
    "position": 10
    },

    2024-01-19 14:36:32
    赞同 展开评论 打赏
  • 这个确认了下,暂不支持—此回答来自钉群“表格存储技术交流群”

    2024-01-18 13:30:04
    赞同 展开评论 打赏
问答标签:
问答地址:

阿里云存储基于飞天盘古2.0分布式存储系统,产品多种多样,充分满足用户数据存储和迁移上云需求。

相关电子书

更多
TableStore在社交类场景下的应用 立即下载
表格存储实时数据流Steam的技术揭秘和应用场景 立即下载
表格存储(TableStore) 立即下载