java - elasticsearch termvectors RESTful 接口返回错误结果
问题描述
我的 Elasticsearch 文档中只存储了一个文档,然后我调用{{es-host}}/word_text/data/AXuBd0JbG6dDNwCvvmgY/_termvectors
了 restful 接口来获取术语 statsitc 信息,请求男孩:
{
"fields": [
"content"
],
"offsets": false,
"payloads": false,
"positions": false,
"term_statistics": true,
"field_statistics": true,
"per_field_analyzer": {
"content": "ik_smart"
}
}
最后,我得到如下结果
{
"_index": "word_text",
"_type": "data",
"_id": "AXuBd0JbG6dDNwCvvmgY",
"_version": 1,
"found": true,
"took": 33,
"term_vectors": {
"content": {
"field_statistics": {
"sum_doc_freq": 342,
"doc_count": 1,
"sum_ttf": 909
},
"terms": {
"10月": {
"term_freq": 1
},
"12": {
"doc_freq": 1,
"ttf": 2,
"term_freq": 2
},
"19日": {
"term_freq": 1
},
"2": {
"doc_freq": 1,
"ttf": 1,
"term_freq": 1
},
"2019": {
"doc_freq": 1,
"ttf": 4,
"term_freq": 3
}
我对这个结果有一些疑问。
理论上每个term应该有doc_freq、ttf、term_freq三个统计属性,但是这个结果中只有一些词有三个属性,有的只有一个属性,缺少doc_freq和ttf属性。
在这个 ES 索引中,只有一个文档。这时候tf值应该和ttf值一样,但是在部分termsstatistics两个值不同。
解决方案
推荐阅读
- javascript - 不能在three.js中播放透明webm?
- zurb-foundation - 切换菜单 - 动画高度
- php - 全新安装中未找到类“类‘表单’”
- sql - Qliksense 中的 SQL 逻辑
- javascript - async await 返回一个 Promise 而不是一个值
- shieldui - FieldType.Number 将编辑值限制为 100,任何超过 100 的值都会自动更改为 100
- python-2.7 - 无法为操作“Variable_4/Adam_1”分配设备
- git - 从 git for windows bash 的 CLI 中清除所有 git 凭据
- javascript - 修改值 - 通过引用传递
- javascript - React 钩子 useState 在上下文提供者中设置多个状态