Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-core/etc/elasticsuite_indices.xml.sample

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<!--
/**
 * Smile_ElasticsuiteCore indices definition example.
 *
 * 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\ElasticsuiteCore
 * @author    Aurelien FOUCRET <aurelien.foucret@smile.fr>
 * @copyright 2020 Smile
 * @license   Open Software License ("OSL") v. 3.0
 */
 -->

<indices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Smile_ElasticsuiteCore:etc/elasticsuite_indices.xsd">

    <index identifier="catalog_product">
        <type name="product">
            <datasources>
                <datasource name="prices">Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\PriceData</datasource>
                <datasource name="categories">Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\CategoryData</datasource>
                <datasource name="attributes">Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\ProductAttributes</datasource>
            </datasources>
            <mapping>
                <!-- Static fields handled by the base indexer (not datasource) -->
                <field name="entity_id" type="integer" />
                <field name="attribute_set_id" type="integer" />
                <field name="has_options" type="boolean" />
                <field name="required_options" type="boolean" />
                <field name="created_at" type="date" />
                <field name="updated_at" type="date" />
                <field name="type_id" type="string" />

                <!-- Static fields handled by the "prices" datasource -->
                <field name="price.price" type="double" nestedPath="price"/>
                <field name="price.original_price" type="double" nestedPath="price"/>
                <field name="price.is_discount" type="boolean" nestedPath="price"/>
                <field name="price.customer_group_id" type="integer" nestedPath="price"/>

                <!-- Static fields handled by the "categories" datasource -->
                <field name="category.category_id" type="integer" nestedPath="category"/>
                <field name="category.position" type="integer" nestedPath="category"/>
                <field name="category.is_parent" type="boolean" nestedPath="category"/>

            </mapping>
        </type>
    </index>

</indices>