Closed 111andre111 closed 6 days ago
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)
Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.
Comments are supported in ES|QL btw: https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-syntax.html#esql-comments
Describe the feature: As of today kuery syntax doesn't offer to add comments to more complex queries. Given that more and more complex queries need to bed used especially in the context of alerts and some other place where kuery is used. https://www.elastic.co/guide/en/kibana/8.8/kuery-query.html https://github.com/elastic/kibana/blob/e98abd0fb5896b573de7ab811534d134d15d7cb9/packages/kbn-es-query/src/kuery/grammar/grammar.peggy
Additional comment: It seems that's as of today not possible. Given on the situation probably sometimes a single line and sometimes a multiline comments might make sense. Given that kuery is based on peg.js fork peggy I think I found here some examples that do exactly what I think about: https://github.com/peggyjs/peggy/blob/e6c380d8de33daedb583427c727313dd0b7f09ea/src/parser.pegjs#L310-L314