-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow search request field mapping to be configured from di.xml
- Loading branch information
1 parent
08c8fa8
commit acb79b5
Showing
11 changed files
with
337 additions
and
77 deletions.
There are no files selected for viewing
173 changes: 173 additions & 0 deletions
173
src/module-elasticsuite-catalog-graph-ql/etc/graphql/di.xml.orig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteCatalogGraphQl | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2020 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<preference for="Magento\CatalogGraphQl\DataProvider\Product\SearchCriteriaBuilder" | ||
type="Smile\ElasticsuiteCatalogGraphQl\DataProvider\Product\SearchCriteriaBuilder"/> | ||
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products" type="Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Products" /> | ||
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\Query\ProductQueryInterface" type="Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Products\Query\Search"/> | ||
|
||
<virtualType name="elasticsuiteSearchResultApplier" type="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplierFactory"> | ||
<arguments> | ||
<argument name="instanceName" xsi:type="string">Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\SearchResultApplier</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ProductSearch"> | ||
<arguments> | ||
<argument name="searchResultsApplierFactory" xsi:type="object">elasticsuiteSearchResultApplier</argument> | ||
</arguments> | ||
</type> | ||
|
||
<!-- 'aggregations' Data Providers --> | ||
<preference for="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Attribute" | ||
type="Smile\ElasticsuiteCatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Attribute"/> | ||
<preference for="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Category" | ||
type="Smile\ElasticsuiteCatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Category"/> | ||
<preference for="Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Price" | ||
type="Smile\ElasticsuiteCatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Price"/> | ||
|
||
|
||
<!-- Layer filters implementation --> | ||
<virtualType name="Smile\ElasticsuiteCatalogGraphQl\Model\ResourceModel\Product\SearchResultCollectionFactory" | ||
type="Magento\Catalog\Model\ResourceModel\Product\CollectionFactory"> | ||
<arguments> | ||
<argument name="instanceName" xsi:type="string">Smile\ElasticsuiteCatalogGraphQl\Model\ResourceModel\Product\SearchResultCollection</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<type name="Smile\ElasticsuiteCatalogGraphQl\Model\Layer\CollectionProvider"> | ||
<arguments> | ||
<argument name="collectionFactory" xsi:type="object">Smile\ElasticsuiteCatalogGraphQl\Model\ResourceModel\Product\SearchResultCollectionFactory</argument> | ||
</arguments> | ||
</type> | ||
|
||
<type name="Magento\CatalogGraphQl\Model\Layer\Context"> | ||
<arguments> | ||
<argument name="collectionProvider" xsi:type="object">Smile\ElasticsuiteCatalogGraphQl\Model\Layer\CollectionProvider</argument> | ||
</arguments> | ||
</type> | ||
|
||
<type name="Magento\Catalog\Model\Layer\Search"> | ||
<arguments> | ||
<argument name="context" xsi:type="object">Magento\CatalogGraphQl\Model\Layer\Context</argument> | ||
</arguments> | ||
</type> | ||
|
||
<type name="Magento\Catalog\Model\Layer\Category"> | ||
<arguments> | ||
<argument name="context" xsi:type="object">Magento\CatalogGraphQl\Model\Layer\Context</argument> | ||
</arguments> | ||
</type> | ||
|
||
<virtualType name="smileEScategoryFilterableAttributesCollection" type="Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory"> | ||
<arguments> | ||
<argument name="instanceName" xsi:type="string">Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\FilterableAttribute\Category\Collection</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<type name="Smile\ElasticsuiteCatalog\Model\Layer\Category\FilterableAttributeList"> | ||
<arguments> | ||
<argument name="collectionFactory" xsi:type="object">smileEScategoryFilterableAttributesCollection</argument> | ||
</arguments> | ||
</type> | ||
|
||
<virtualType name="categoryFilterList" type="Smile\ElasticsuiteCatalog\Model\Layer\FilterList"> | ||
<arguments> | ||
<argument name="filterableAttributes" xsi:type="object">Smile\ElasticsuiteCatalog\Model\Layer\Category\FilterableAttributeList</argument> | ||
<argument name="filters" xsi:type="array"> | ||
<item name="attribute" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Attribute</item> | ||
<item name="price" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Price</item> | ||
<item name="decimal" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Decimal</item> | ||
<item name="category" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Category</item> | ||
<item name="boolean" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Boolean</item> | ||
</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<virtualType name="searchFilterList" type="Smile\ElasticsuiteCatalog\Model\Layer\FilterList"> | ||
<arguments> | ||
<argument name="filterableAttributes" xsi:type="object">Smile\ElasticsuiteCatalog\Model\Layer\Search\FilterableAttributeList</argument> | ||
<argument name="filters" xsi:type="array"> | ||
<item name="attribute" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Attribute</item> | ||
<item name="price" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Price</item> | ||
<item name="decimal" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Decimal</item> | ||
<item name="category" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Category</item> | ||
<item name="boolean" xsi:type="string">Smile\ElasticsuiteCatalog\Model\Layer\Filter\Boolean</item> | ||
</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<type name="Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Layer\FiltersProvider"> | ||
<arguments> | ||
<argument name="filtersList" xsi:type="array"> | ||
<item name="search" xsi:type="object">searchFilterList</item> | ||
<item name="category" xsi:type="object">categoryFilterList</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
|
||
<preference for="Magento\CatalogGraphQl\Model\Resolver\Layer\FiltersProvider" type="Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Layer\FiltersProvider"/> | ||
|
||
<type name="Magento\CatalogGraphQl\Model\Resolver\LayerFilters"> | ||
<plugin name="search_results_aggregations" type="Smile\ElasticsuiteCatalogGraphQl\Plugin\Resolver\LayerFilters"/> | ||
</type> | ||
|
||
<!-- Layered navigation filtering : Aggregation building and modifying --> | ||
<type name="\Smile\ElasticsuiteCatalog\Search\Request\Product\Aggregation\Provider\FilterableAttributes\Modifier\Coverage"> | ||
<arguments> | ||
<argument name="coverageRequestBuilder" xsi:type="object">\Smile\ElasticsuiteCatalog\Search\Request\Product\Coverage\Builder</argument> | ||
</arguments> | ||
</type> | ||
|
||
<type name="\Smile\ElasticsuiteCatalog\Search\Request\Product\Aggregation\Provider\FilterableAttributes"> | ||
<arguments> | ||
<argument name="modifiersPool" xsi:type="array"> | ||
<item name="coverageModifier" xsi:type="object">Smile\ElasticsuiteCatalog\Search\Request\Product\Aggregation\Provider\FilterableAttributes\Modifier\Coverage</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
<<<<<<< HEAD | ||
======= | ||
|
||
<virtualType name="elasticsuiteCollectionPreProcessor" type="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CompositeCollectionProcessor"> | ||
<arguments> | ||
<argument name="collectionProcessors" xsi:type="array"> | ||
<item name="search" xsi:type="object">Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\SearchCriteriaProcessor</item> | ||
</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<virtualType name="elasticsuiteProductProvider" type="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ProductSearch"> | ||
<arguments> | ||
<argument name="collectionPreProcessor" xsi:type="object">elasticsuiteCollectionPreProcessor</argument> | ||
</arguments> | ||
</virtualType> | ||
|
||
<type name="Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Products\Query\Search"> | ||
<arguments> | ||
<argument name="productProvider" xsi:type="object">elasticsuiteProductProvider</argument> | ||
</arguments> | ||
</type> | ||
|
||
<type name="Smile\ElasticsuiteCatalog\Model\Search\Request\Field\Mapper"> | ||
<arguments> | ||
<argument name="fieldNameMapping" xsi:type="array"> | ||
<item name="category_id" xsi:type="string">category.category_id</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
>>>>>>> d9e5929... Allow search request field mapping to be configured from di.xml | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.