ES禁用_source不会影响聚合
2024-10-20 08:44:18
From Elasticsearch's website:
The _source field contains the original JSON document body that was passed at index time. The _source field itself is not indexed (and thus is not searchable), but it is stored so that it can be returned when executing fetch requests, like get or search
Disabling the source will prevent Elasticsearch from displaying it in the resultset. However, filtering, querying and aggregations will not be affected.
So these two queries will not generate any results in terms of the actual body:
GET mq-body-local/body/_search
GET mq-body-local/body/1
However, you could run this aggregation that will include some of the source, for example:
POST mq-body-local/body/_search
{
"aggs": {
"test": {
"terms": {
"field": "body"
}
}
}
}
Will produce this result set (I've created some test records):
"aggregations": {
"test": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "my body",
"doc_count": 1
},
{
"key": "my body2",
"doc_count": 1
}
]
}
}
最新文章
- 浏览器功能记住账号和密码解决方法(HTML解决方式)
- React Ntive 学习手记
- css整理-03 文本
- PhysX
- ehcache 的配置
- apache服务器php程序
- QT QObject::connect函数的学习
- C程序设计语言练习题1-10
- Unity怎样在Editor下运行协程(coroutine)
- Oracle函数之chr
- 杂记:腾讯暑期实习 Web 后端开发面试经历
- 2018秋寒假作业6—PTA编程总结3
- 基于位置的服务——百度地图SDK练习
- Android组件化demo实现以及遇坑分享
- Sightseeing tour HDU - 1956(混合欧拉回路)
- C++赋值兼容原则
- Windows使用(类)Unix环境那些事
- Oracle AP更新供应商
- Dream------Hadoop--FSDataInputStream和FSDataOutputStream
- Beta周王者荣耀交流协会第三次Scrum会议