作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图用 source filtering. 排除一些字段
我创建了一个索引:
put testindex
{
"mappings": {
"type1": {
"properties":{
"name": { "type": "text" },
"age": { "type": "integer" }
}
}
}
}
插入文档:
put testindex/type1/a
{
"name":"toto",
"age":23
}
并尝试过滤查询:
get testindex/_search
{
"_source": {
"excludes": [ "age" ]
},
"query": {
"bool": {
"should": []
}
}
}
结果是:
"hits": [
{
"_index": "testindex",
"_type": "type1",
"_id": "a",
"_score": 1,
"_source": {
"name": "toto",
"age": 23
}
}
]
我不明白为什么它不隐藏 _source 中的“年龄”字段。_source: false 给出相同的结果。
我使用了 elasticsearch & kibana 5.6
最佳答案
好的,我找到了。这可能是由于 Kibana。当我对“get”使用小写字母时。它不起作用。
get testindex/_search
{
"_source": {
"excludes": [ "age" ]
},
"query": {
"bool": {
"should": []
}
}
}
当我使用大写时,它起作用了。我真的不知道为什么,但就是这样..
GET testindex/_search
{
"_source": {
"excludes": [ "name" ]
},
"query": {
"bool": {
"should": []
}
}
}
关于elasticsearch - 源过滤不适用于 kibana,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47578174/
我是一名优秀的程序员,十分优秀!