Dev Tools query not working on Discover Query

Hi!

Kibana: 7.6.2
Our team is trying to create a navigation tool on the Kibana dashboard for specific filters. We have made the filters and necessary markdown for the dashboard. However we are stuck with one query that won't work. Most of the filters we made were simple statements like: [statement OR/AND statement]. The last query we need is like this: [(statement 1 AND statement 2) or (statement 3 AND statement 4)]. We have made this work using the Kibana Search Bar and in Dev Tools but it won't work as Query DSL for filter. Here's the query from dev tools:

{
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "bool": {
            "should": [
              {
                "bool": {
                  "filter": [
                    {
                      "nested": {
                        "path": "pickups",
                        "query": {
                          "bool": {
                            "should": [
                              {
                                "exists": {
                                  "field": "pickups.arrival"
                                }
                              }
                            ],
                            "minimum_should_match": 1
                          }
                        },
                        "score_mode": "none"
                      }
                    },
                    {
                      "bool": {
                        "must_not": {
                          "nested": {
                            "path": "dropoffs",
                            "query": {
                              "bool": {
                                "should": [
                                  {
                                    "exists": {
                                      "field": "dropoffs.arrival"
                                    }
                                  }
                                ],
                                "minimum_should_match": 1
                              }
                            },
                            "score_mode": "none"
                          }
                        }
                      }
                    }
                  ]
                }
              },
              {
                "bool": {
                  "filter": [
                    {
                      "bool": {
                        "must_not": {
                          "nested": {
                            "path": "pickups",
                            "query": {
                              "bool": {
                                "should": [
                                  {
                                    "exists": {
                                      "field": "pickups.arrival"
                                    }
                                  }
                                ],
                                "minimum_should_match": 1
                              }
                            },
                            "score_mode": "none"
                          }
                        }
                      }
                    },
                    {
                      "nested": {
                        "path": "dropoffs",
                        "query": {
                          "bool": {
                            "should": [
                              {
                                "exists": {
                                  "field": "dropoffs.arrival"
                                }
                              }
                            ],
                            "minimum_should_match": 1
                          }
                        },
                        "score_mode": "none"
                      }
                    }
                  ]
                }
              }
            ],
            "minimum_should_match": 1
          }  
        }
      ]
    }
  }
}

Pretty much copied the query from Inspect. Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.