作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我认为标题是不言自明的。据我所知 indices-stats
仅返回集合中文档的数量,而不返回 token /术语的数量。
编辑:
以下是有关我的索引的更多信息;它包含用以下映射索引的医学出版物:
{
u'papers': {
u'properties': {
u'article_abstract': {
u'type':
u'string'
},
u'article_sections': {
u'type':
u'string'
},
u'article_text': {
u'type':
u'string'
},
u'article_title': {
u'type':
u'string'
},
u'keyword_group': {
u'type':
u'string'
},
u'references': {
u'type':
u'string'
}
}
}
}
最佳答案
可以从相同indices-stats api的store
字段中获取索引的文件大小,例如{ "docs": { "count": 1886, "deleted": 1557 }, "store": { "size_in_bytes": 519544594, "throttle_time_in_millis": 0 }, ...(skipped)
但是,如果您想要索引的总 token 量,我认为不存在这样的api,因为它意义不大。如果您想要数字,我认为您需要使用script_field
和aggregation
进行计算。
编辑:
根据您的架构, token 计数可以如下计算:
{
"query" : {
"match_all" : { }
},
"aggs" : {
"summation" : { "sum" : { "script" : "doc['article_abstract'].values.length+doc['article_sections'].values.length" } }
}
}
关于elasticsearch - 如何在ElasticSearch中获取倒排索引的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25596982/
我是一名优秀的程序员,十分优秀!