源过滤不适用于 kibana
Source filtering not working on kibana
我试图用 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": []
}
}
}
我试图用 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": []
}
}
}