// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await 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",
                    },
                  },
                ],
              },
            },
          ],
        },
      },
    },
  },
});
console.log(response);
----
