// This file is autogenerated, DO NOT EDIT
// query-dsl/intervals-query.asciidoc:28

[source, python]
----
resp = client.search(
    query={
        "intervals": {
            "my_text": {
                "all_of": {
                    "ordered": True,
                    "intervals": [
                        {
                            "match": {
                                "query": "my favorite food",
                                "max_gaps": 0,
                                "ordered": True
                            }
                        },
                        {
                            "any_of": {
                                "intervals": [
                                    {
                                        "match": {
                                            "query": "hot water"
                                        }
                                    },
                                    {
                                        "match": {
                                            "query": "cold porridge"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        }
    },
)
print(resp)
----
