Smile-SA/elasticsuite

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

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<!--
/**
 * Smile_ElasticsuiteCatalog indices configuration.
 *
 * 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\ElasticsuiteTracker
 * @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="tracking_log_event" defaultSearchType="event">
        <type name="event" idFieldName="event_id">
            <mapping>
                <!-- Event metadata -->
                <field name="event_id" type="keyword" />
                <field name="date" type="date" />

                <!-- Session data -->
                <field name="session.uid" type="keyword" />
                <field name="session.vid" type="keyword" />

                <!-- Customer data -->
                <field name="customer.group_id" type="integer" />

                <!-- Page metadata -->
                <field name="page.site" type="keyword" />
                <field name="page.store_id" type="integer" />
                <field name="page.title" type="keyword" />
                <field name="page.url" type="keyword" />

                <!-- Page data (type) -->
                <field name="page.type.identifier" type="keyword" />
                <field name="page.type.label" type="keyword" />

                <!-- Page data (category) -->
                <field name="page.category.id" type="integer" />
                <field name="page.category.label" type="keyword" />
                <field name="page.category.path" type="keyword" />

                <!-- Page data (cart) -->
                <field name="page.cart.product_id" type="integer" />

                <!-- Page data (product) -->
                <field name="page.product.id" type="integer" />
                <field name="page.product.sku" type="text">
                    <isSearchable>1</isSearchable>
                    <defaultSearchAnalyzer>whitespace</defaultSearchAnalyzer>
                </field>
                <field name="page.product.label" type="text">
                    <isSearchable>1</isSearchable>
                </field>

                <!-- Page data (product list) -->
                <field name="page.product_list.current_page" type="integer" />
                <field name="page.product_list.page_count" type="integer" />
                <field name="page.product_list.product_count" type="integer" />
                <field name="page.product_list.display_mode" type="keyword" />
                <field name="page.product_list.sort_order" type="keyword" />
                <field name="page.product_list.sort_direction" type="keyword" />
                <field name="page.product_list.filters.name" type="keyword" nestedPath="page.product_list.filters" />
                <field name="page.product_list.filters.value" type="keyword" nestedPath="page.product_list.filters" />

                <!-- Page data (searches) -->
                <field name="page.search.query" type="text">
                    <isSearchable>1</isSearchable>
                    <isUsedForSortBy>1</isUsedForSortBy>
                </field>
                <field name="page.search.query_id" type="integer" />
                <field name="page.search.is_spellchecked" type="boolean" />

                <!-- Page data (CMS) -->
                <field name="page.cms.identifier" type="text">
                    <isSearchable>1</isSearchable>
                </field>
                <field name="page.cms.title" type="text">
                    <isSearchable>1</isSearchable>
                </field>

                <!-- Page data (order) -->
                <field name="page.order.grand_total" type="double" />
                <field name="page.order.discount_total" type="double" />
                <field name="page.order.shipping_total" type="double" />
                <field name="page.order.subtotal" type="double" />
                <field name="page.order.payment_method" type="keyword" />
                <field name="page.order.shipping_method" type="keyword" />
                <field name="page.order.salesrules" type="keyword" />
                <field name="page.order.items.sku" type="keyword" nestedPath="page.order.items" />
                <field name="page.order.items.product_id" type="keyword" nestedPath="page.order.items" />
                <field name="page.order.items.category_ids" type="integer" nestedPath="page.order.items" />
                <field name="page.order.items.label" type="keyword" nestedPath="page.order.items" />
                <field name="page.order.items.price" type="double" nestedPath="page.order.items" />
                <field name="page.order.items.row_total" type="double" nestedPath="page.order.items" />
                <field name="page.order.items.qty" type="double" nestedPath="page.order.items" />

                <!-- Page data (referrer) -->
                <field name="page.referrer.domain" type="keyword" />
                <field name="page.referrer.page" type="keyword" />

                <!-- Page data (campaign) -->
                <field name="page.utm_source" type="keyword" />
                <field name="page.utm_campaign" type="keyword" />
                <field name="page.utm_medium" type="keyword" />
                <field name="page.utm_term" type="keyword" />

                <!-- Page data (resolution) -->
                <field name="page.resolution.x" type="integer" />
                <field name="page.resolution.y" type="integer" />
            </mapping>
        </type>
    </index>

    <index identifier="tracking_log_session" defaultSearchType="session">
        <type name="session" idFieldName="session_id">
            <mapping>
                <field name="session_id" type="keyword"/>
                <field name="start_date" type="date"/>
                <field name="end_date" type="date"/>
                <field name="visitor_id" type="keyword"/>
                <field name="product_view" type="integer" />
                <field name="product_cart" type="integer" />
                <field name="category_view" type="integer" />
                <field name="search_query" type="text">
                    <isSearchable>1</isSearchable>
                </field>
                <field name="search_query_void" type="text">
                    <isSearchable>1</isSearchable>
                    <isUsedForSortBy>1</isUsedForSortBy>
                </field>
                <field name="product_sale" type="integer" />
                <field name="category_sale" type="integer" />
            </mapping>
        </type>
    </index>

</indices>