Not able to Combine Interval Queries with Other Bool Filter

I am using Elastic intervals Queries https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-intervals-query.html#query-dsl-intervals-query

I want to combine interval queries with another range filter But I am not able to apply other filters.

Here is my sample query

  {
  "query": {
    "bool": {
      "filter": {
        "range": {
          "session_end_time": {
            "from": "2019-09-11T00:00:00.000Z",
            "to": "2019-09-12T23:59:59.999Z",
            "include_lower": true,
            "include_upper": true,
            "format": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
          }
        }
      }
    },
    "intervals": {
      "ordered_session_events": {
        "any_of": {
          "intervals": [
            {
              "match": {
                "query": "text1 text2 text3",
                "max_gaps": -1,
                "ordered": true
              }
            }
          ]
        }
      }
    }
  },
  "aggregations": {
    "count": {
      "cardinality": {
        "field": "sessn_id"
      }
    }
  }
}

I am getting below error

{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 16,
"col": 9
}
],
"type": "parsing_exception",
"reason": "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 16,
"col": 9
},
"status": 400
}

the structure of the bool query needs to be fixed. the filter part of the bool query needs to be an array, that contains the range and the intervals within the filter field.

Thanks, That Worked.

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