Skip to content

Bug in search bar ES query DSL for top level grouped clauses #2109

@bevacqua

Description

@bevacqua

Can be reproduced in first demo of https://elastic.github.io/eui/#/forms/search-bar

This is fine

✅ Input: status:open
✅ ES QS: +status:open
✅ ES Query DSL:

{
  "bool": {
    "must": [
      {
        "match": {
          "status": {
            "query": "open",
            "operator": "and"
          }
        }
      }
    ]
  }
}

This is not fine

✅ Input: (status:open)
✅ ES QS: +(status:open)
❎ ES Query DSL: the bool.must.bool.should clause has an array inside another array

{
  "bool": {
    "must": [
      {
        "bool": {
          "should": [
            [
              {
                "bool": {
                  "must": [
                    {
                      "match": {
                        "status": {
                          "query": "open",
                          "operator": "and"
                        }
                      }
                    }
                  ]
                }
              }
            ]
          ]
        }
      }
    ]
  }
}

Adding more terms e.g. (status:open OR status:closed) doesn't seem to have an effect here

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions