es创建全文检索示例2

接上一篇:

https://mp.csdn.net/console/editor/html/107064358

10、查询单条数据中分词字段

一般会按照id查询详细内容,fields字段为指定的字段名称。

http://localhost:9200/news/_doc/3/_termvectors?fields=text_db&offsets=false&positions=false&payloads=false&term_statistics=false

其中:3是id,即:_id = 3,其他参数用于控制结果中显示的区域。

显示结果如下:

{
    "_index": "news",
    "_type": "_doc",
    "_id": "3",
    "_version": 1,
    "found": true,
    "took": 2,
    "term_vectors": {
        "text_db": {
            "field_statistics": {
                "sum_doc_freq": 500,
                "doc_count": 2,
                "sum_ttf": 870
            },
            "terms": {
                "16": {
                    "term_freq": 1
                },
                "1214272": {
                    "term_freq": 1
                },
                "19日": {
                    "term_freq": 1
                },
                "2020-07-24": {
                    "term_freq": 1
                },
                "21日": {
                    "term_freq": 1
                },
                "23日": {
                    "term_freq": 2
                },
                "5月": {
                    "term_freq": 1
                },
                "73届": {
                    "term_freq": 1
                },
                "7月": {
                    "term_freq": 1
                },
                "一个": {
                    "term_freq": 1
                },
                "一件事": {
                    "term_freq": 1
                },
                "上说": {
                    "term_freq": 2
                },
                "上述": {
                    "term_freq": 1
                },
                "不": {
                    "term_freq": 1
                },
                "不会": {
                    "term_freq": 2
                },
                "不分": {
                    "term_freq": 1
                },
                "不实": {
                    "term_freq": 3
                },
                "不得": {
                    "term_freq": 1
                },
                "世界上": {
                    "term_freq": 1
                },
                "世界卫生": {
                    "term_freq": 1
                },
                "世界卫生组织": {
                    "term_freq": 3
                },
                "丧生": {
                    "term_freq": 1
                },
                "个": {
                    "term_freq": 1
                },
                "中": {
                    "term_freq": 2
                },
                "中国": {
                    "term_freq": 3
                },
                "为": {
                    "term_freq": 2
                },
                "主任": {
                    "term_freq": 1
                },
                "主流": {
                    "term_freq": 1
                },
                "举行": {
                    "term_freq": 1
                },
                "之一": {
                    "term_freq": 1
                },
                "之争": {
                    "term_freq": 1
                },
                "也": {
                    "term_freq": 4
                },
                "书面": {
                    "term_freq": 1
                },
                "买通": {
                    "term_freq": 1
                },
                "事情": {
                    "term_freq": 1
                },
                "于": {
                    "term_freq": 1
                },
                "人": {
                    "term_freq": 1
                },
                "人在": {
                    "term_freq": 1
                },
                "仍是": {
                    "term_freq": 1
                },
                "任何人": {
                    "term_freq": 1
                },
                "会": {
                    "term_freq": 1
                },
                "体验": {
                    "term_freq": 1
                },
                "佩": {
                    "term_freq": 5
                },
                "例行": {
                    "term_freq": 1
                },
                "供": {
                    "term_freq": 1
                },
                "依法": {
                    "term_freq": 1
                },
                "保持": {
                    "term_freq": 1
                },
                "修改": {
                    "term_freq": 1
                },
                "克": {
                    "term_freq": 1
                },
                "党派": {
                    "term_freq": 1
                },
                "再次": {
                    "term_freq": 1
                },
                "冠": {
                    "term_freq": 2
                },
                "凯": {
                    "term_freq": 1
                },
                "出任": {
                    "term_freq": 1
                }

}
        }
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值