17

你能告诉我如何在Kibana Dev Tools 控制台中注释掉行吗?我对注释语法很感兴趣。

4

3 回答 3

30

Kibana 开发工具不支持查询中的注释

但是,您可以#在查询之前或之后或在查询之间使用来编写评论。

# This is a  comment
GET /_search
{
  "query": {
    "match_all": {}
  }
}

# This is another comment
POST /index/_delete_by_query
{
  "query": {
    "match": {
      "name": "abra ka dabra"
    }
  }
}
于 2018-12-05T12:20:26.730 回答
6

您可以使用 一次注释掉一行#。例如:

# This is a search command
GET /_search
{
  "query": {
    "match_all": {}
  }
}
于 2018-10-01T17:30:44.530 回答
0

如果您要注释掉一行或多行,您可以添加/* */,例如,/* "field": "statType.keyword" */

GET /exercise-index/_search
{ 
  "_source": {
    "includes": ["content"]
  }, 
  "query": {
    "exists": {"field": "inclination"}
  },
  "aggs": {
    "location": {
      "terms": {
        "field": "location"
        /* "size": 10 */
      }
    }
  }
}

在上面的查询中,我们用 . 注释掉了 agg 中的一行/* */

PS:

  1. 添加一行后语法检查会失败/* */,但不影响查询。
  2. add 之后/* */,需要去掉前一行的逗号,才能符合 json 语法。
于 2022-02-10T03:23:04.600 回答