<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <defaults public="true" />

        <!-- Shopware Search -->
        <service id="shopware_search.product_search" class="Shopware\Bundle\SearchBundle\ProductSearch">
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\ListProductServiceInterface"/>
            <argument type="service" id="Shopware\Bundle\SearchBundle\ProductNumberSearchInterface"/>
        </service>

        <service id="shopware_search.search_term_pre_processor" class="Shopware\Bundle\SearchBundle\SearchTermPreProcessor" />

        <service id="shopware_search.core_criteria_request_handler" class="Shopware\Bundle\SearchBundle\CriteriaRequestHandler\CoreCriteriaRequestHandler">
            <argument type="service" id="Shopware_Components_Config" />
            <argument type="service" id="Shopware\Bundle\SearchBundle\SearchTermPreProcessorInterface" />

            <tag name="criteria_request_handler"/>
        </service>

        <service id="shopware_search.sorting_criteria_request_handler" class="Shopware\Bundle\SearchBundle\CriteriaRequestHandler\SortingCriteriaRequestHandler">
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\CustomSortingServiceInterface" />

            <tag name="criteria_request_handler" />
        </service>

        <service id="shopware_search.custom_facet_criteria_request_handler" class="Shopware\Bundle\SearchBundle\CriteriaRequestHandler\FacetCriteriaRequestHandler">
            <argument type="service" id="Shopware_Components_Config" />
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\CustomFacetServiceInterface" />

            <tag name="criteria_request_handler" />
        </service>

        <service id="shopware_search.property_criteria_request_handler" class="Shopware\Bundle\SearchBundle\CriteriaRequestHandler\PropertyCriteriaRequestHandler">
            <argument type="service" id="Doctrine\DBAL\Connection" />

            <tag name="criteria_request_handler"/>
        </service>

        <service class="Shopware\Bundle\SearchBundle\CriteriaRequestHandler\VariantCriteriaRequestHandler" id="shopware_bundle_search.criteria_request_handler.variant_criteria_request_handler">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Bundle\SearchBundleDBAL\VariantHelperInterface"/>

            <tag name="criteria_request_handler"/>
        </service>

        <service id="shopware_search.store_front_criteria_factory" class="Shopware\Bundle\SearchBundle\StoreFrontCriteriaFactory" >
            <argument type="service" id="Shopware_Components_Config" />
            <argument type="service" id="Shopware\Components\ContainerAwareEventManager" />
            <argument type="tagged" tag="criteria_request_handler" /><!--Criteria request handlers -->
        </service>

        <service id="shopware_search.batch_product_number_search" class="Shopware\Bundle\SearchBundle\BatchProductNumberSearch">
            <argument type="service" id="Shopware\Bundle\SearchBundle\ProductNumberSearchInterface" />
            <argument type="service" id="shopware_storefront.base_product_factory" />
        </service>

        <service id="shopware_search.batch_product_search" class="Shopware\Bundle\SearchBundle\BatchProductSearch">
            <argument type="service" id="shopware_search.batch_product_number_search" />
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\ListProductServiceInterface" />
        </service>

        <service id="shopware_search.category_tree_facet_result_builder" class="Shopware\Bundle\SearchBundle\FacetResult\CategoryTreeFacetResultBuilder">
            <argument type="service" id="Shopware_Components_Snippet_Manager" />
            <argument type="service" id="Shopware\Components\QueryAliasMapper" />
        </service>

        <service class="Shopware\Bundle\SearchBundle\VariantSearch"
                 id="shopware_search.variant_search"
                 decorates="Shopware\Bundle\SearchBundle\ProductSearchInterface">

            <argument type="service" id="shopware_search.variant_search.inner"/>
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\VariantListingPriceServiceInterface"/>
            <argument type="service" id="Shopware\Bundle\StoreFrontBundle\Service\ConfiguratorServiceInterface"/>
        </service>

    </services>
</container>
