<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
    <xs:include schemaLocation="urn:magento:framework:Search/etc/requests.xsd"/>
    <xs:complexType name="requests">
        <xs:sequence>
            <xs:element type="request" name="request" maxOccurs="unbounded">
                <xs:keyref name="requestQueryReference" refer="queryName">
                    <xs:selector xpath="."/>
                    <xs:field xpath="@query"/>
                </xs:keyref>
                <xs:keyref name="queryReference" refer="queryName">
                    <xs:selector xpath=".//queryReference"/>
                    <xs:field xpath="@ref"/>
                </xs:keyref>

                <xs:keyref name="filterReference" refer="filterName">
                    <xs:selector xpath=".//filterReference"/>
                    <xs:field xpath="@ref"/>
                </xs:keyref>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="requests" type="requests">
        <xs:unique name="uniqueRequest">
            <xs:selector xpath="./*" />
            <xs:field xpath="@query" />
        </xs:unique>
    </xs:element>
</xs:schema>
