[source, ruby]
----
response = client.search(
  body: {
    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'
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
)
puts response
----
