简体   繁体   English

源代码过滤不适用于kibana

[英]Source filtering not working on kibana

I am trying to exclude some field with source filtering. 我正在尝试通过源过滤排除某些字段

I create an index: 我创建一个索引:

put testindex
{
  "mappings": {
    "type1": {
      "properties":{
        "name": { "type": "text"  },
        "age": { "type": "integer" }
      }
    }
  }
}

insert a document: 插入文件:

put testindex/type1/a
{
  "name":"toto",
  "age":23
}

and try a filtered query: 并尝试过滤查询:

get testindex/_search
{
  "_source": {
        "excludes": [ "age" ]
    },
  "query": {
    "bool": {
      "should": []
    }
  }
} 

the result is: 结果是:

"hits": [
  {
    "_index": "testindex",
    "_type": "type1",
    "_id": "a",
    "_score": 1,
    "_source": {
      "name": "toto",
      "age": 23
    }
  }
]

I don't understand why it does not hide the "age" field in _source. 我不明白为什么它不隐藏_source中的“ age”字段。 _source: false give the same result. _source:false给出相同的结果。
I used elasticsearch & kibana 5.6 我使用了elasticsearch和kibana 5.6

Ok I found it. 好的,我找到了。 It's probably due to Kibana. 这可能是由于Kibana。 When I use lowercase for the "get". 当我对“ get”使用小写字母时。 It does not work. 这是行不通的。

get testindex/_search
{
  "_source": {
        "excludes": [ "age" ]
    },
  "query": {
    "bool": {
      "should": []
    }
  }
}

When I use uppercase, it work. 当我使用大写字母时,它可以工作。 I don't really know why but that's it.. 我真的不知道为什么,就是这样。

GET testindex/_search
{ 
  "_source": {
        "excludes": [ "name" ]
    },
  "query": {
    "bool": {
      "should": []
    }
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM