elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.14k forks source link

[DevTools][Console] Autocomplete missing suggestion in "filter" #188264

Open KyleOnK8s opened 2 months ago

KyleOnK8s commented 2 months ago

Kibana version: 8.14.2

Elasticsearch version: 8.14.2

Server OS version: Elastic Cloud

Browser version: Chrome

Browser OS version: Version 126.0.6478.127 (Official Build) (arm64)

Original install method (e.g. download page, yum, from source, etc.): Cloud

Describe the bug:

The autocomplete for DevTools Console does not list match as an option when attempting to filter.

Steps to reproduce:

  1. Open Console
  2. Paste
    GET _search
    {
    "query": {
    "bool": {
      "filter": [
        {
          ""
        }
      ]
    }
    }
    }
  3. Inside the double quotes, start to type "match". It will not be one of the listed options.

Expected behavior:

Match should be presented in the list of suggestions. This functionality is specifically called out in the Elasticsearch Engineer labs but does not autocomplete, making the lab more difficult to complete if you're not familiar with the syntax.

Screenshots (if relevant):

image

Errors in browser console (if relevant): N/A

Provide logs and/or server output (if relevant): N/A

Any additional context: N/A

a03nikki commented 2 months ago

Also missing is not a valid query option. One has to use must_not[].exists.

GET logs-*/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "missing": {
            "field": "message"
          }
        }
      ]
    }
  }
}
{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "unknown query [missing]",
        "line": 6,
        "col": 22
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[6:22] [bool] failed to parse field [filter]",
    "caused_by": {
      "type": "parsing_exception",
      "reason": "unknown query [missing]",
      "line": 6,
      "col": 22,
      "caused_by": {
        "type": "named_object_not_found_exception",
        "reason": "[6:22] unknown field [missing]"
      }
    }
  },
  "status": 400
}

There is though a missing aggregation, https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html.

limit does not exist either as a query option.

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "unknown query [limit]",
        "line": 6,
        "col": 20
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[6:20] [bool] failed to parse field [filter]",
    "caused_by": {
      "type": "parsing_exception",
      "reason": "unknown query [limit]",
      "line": 6,
      "col": 20,
      "caused_by": {
        "type": "named_object_not_found_exception",
        "reason": "[6:20] unknown field [limit]"
      }
    }
  },
  "status": 400
}

I know limit goes with mapping settings per https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-settings-limit.html.

elasticmachine commented 2 months ago

Pinging @elastic/kibana-management (Team:Kibana Management)