Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-core/etc/adminhtml/system.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<!--
/**
 * Smile_ElasticsuiteCore admin configuration UI fields.
 *
 * 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
 */
 -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

        <tab id="smile_elasticsuite" translate="label" sortOrder="210">
            <label>ElasticSuite</label>
        </tab>

        <section id="smile_elasticsuite_core_base_settings" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Base Settings</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Catalog::config_smile_elasticsuite_core_base_settings</resource>

            <group id="es_client" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Elasticsearch Client</label>
                <field id="servers" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Elasticsearch Servers List</label>
                    <comment>List of servers in [host]:[port] format separated by a comma (e.g. : "es-node1.fqdn:9200, es-node2.fqdn:9200")</comment>
                </field>
                <field id="enable_https_mode" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Use HTTPS</label>
                    <comment>Select yes if you want to connect to your Elasticsearch server over HTTPS.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="enable_certificate_validation" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Use SSL certificate Validation</label>
                    <comment>Select no if you are using self-signed SSL certificate.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="enable_http_auth" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Enable basic HTTP authentication</label>
                    <comment>Enable this option when your Elasticsearch server use basic HTTP authentication.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="enable_http_auth_encoding" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Encode HTTP authorization headers</label>
                    <comment>Enable this option when you want to base64 encode the Authorization headers. (Open Distro requires this)</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="http_auth_user" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Basic HTTP authentication user</label>
                    <depends>
                        <field id="enable_http_auth">1</field>
                    </depends>
                </field>
                <field id="http_auth_pwd" translate="label comment" type="text" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Basic HTTP authentication password</label>
                    <depends>
                        <field id="enable_http_auth">1</field>
                    </depends>
                </field>
                <field id="enable_error_request_logging" translate="label comment" type="select" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Enable logging of request that produce errors</label>
                    <comment><![CDATA[This is an alternative to the debug mode for production environments. If enabled, even when the debug mode is disabled, the body of search requests that produce an error will be logged. If disabled, only the error message/exception message will be logged (legacy behavior). A log rotation system on the var/log/system.log file is advised if enabled.]]></comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="enable_debug_mode" translate="label comment" type="select" sortOrder="75" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Enable Debug Mode</label>
                    <comment>When enabled the module will produce logs through Magento logging system.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="connection_timeout" translate="label comment" type="text" sortOrder="80" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Server Connection Timeout</label>
                    <comment>In seconds.</comment>
                    <frontend_class>validate-number</frontend_class>
                </field>
                <field id="max_retries" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Elasticsearch Client Maximum Number of Retries</label>
                    <comment>Maximum number of times to retry connection when there is a connection failure</comment>
                    <frontend_class>validate-number</frontend_class>
                </field>
            </group>

            <group id="indices_settings" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Indices Settings</label>
                <field id="alias" translate="label" type="text" sortOrder="57" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Indices Alias Name</label>
                </field>
                <field id="indices_pattern" translate="label" type="text" sortOrder="58" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Indices Name Pattern</label>
                </field>
                <field id="number_of_shards" translate="label" type="text" sortOrder="59" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Default Number of Shards per Index</label>
                    <frontend_class>validate-number</frontend_class>
                </field>
                <field id="number_of_replicas" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Default Number of Replicas per Index</label>
                    <frontend_class>validate-number</frontend_class>
                </field>
                <field id="custom_number_of_shards_and_replicas_per_index" translate="label" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Custom settings per Index</label>
                    <frontend_model>Smile\ElasticsuiteCore\Block\Adminhtml\Form\Field\IndicesSettings\DynamicField</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                </field>
            </group>

        </section>

        <section id="smile_elasticsuite_core_analysis_settings" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Analyzers Settings</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Catalog::config_smile_elasticsuite_core_analysis_settings</resource>

            <group id="reference_analyzer" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Reference analyzer configuration</label>
                <field id="trim_leading_zeroes" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Remove leading zeroes of numeric parts</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[If enabled, when indexing a reference like "VT0009", it will be as if "VT9" was indexed instead (leading to independant elements "VT", "9" and "VT9" in the search index). This will allow someone searching for "vt9" or "vt 9" to find the product with the exact "VT0009" sku.]]></comment>
                </field>
                <field id="trim_trailing_zeroes" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Remove trailing zeroes of numeric parts</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[If enabled, when indexing a reference like "DC3000", it will be as if "DC3" was indexed instead (leading to independant elements "DC", "3" and "DC3" in the search index). This will allow someone searching for "dc3" or "dc 3" to find the product with the exact "DC3000" sku.]]></comment>
                </field>
                <field id="reduce_zeroes" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Reduce series of contiguous zeroes in numeric parts</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[If enabled, when indexing a reference like "PL20004", it will be as if "PL204" was indexed instead (leading to independant elements "PL", "204" and "PL204" in the search index). This will allow someone searching for "pl204", "pl 204", "pl2004" or "pl 2004" to find the product with the exact "PL2004" sku.]]></comment>
                </field>
            </group>

            <group id="stemmer" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Language stemmer configuration</label>
                <field id="info" translate="label comment" type="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" >
                    <label>Settings available at the store view scope only.</label>
                    <comment><![CDATA[The ability to select an alternative language stemmer is only available at the store view scope.]]></comment>
                    <frontend_model>Smile\ElasticsuiteCore\Block\Adminhtml\System\Config\Comment</frontend_model>
                </field>
                <field id="use_default" translate="label comment" type="select" sortOrder="50" showInDefault="0" showInWebsite="0" showInStore="1" canRestore="1">
                    <label>Use default stemmer</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[Use the default language stemmer as defined in 'elasticsuite_analysis.xml' file for this store language (as defined by the store locale). If set to No, you'll be able to select a different stemmer for languages that have multiple possible stemmers (Dutch, English, Finnish, French, Galician, German, Hungarian, Italian, Norwegian, Portuguese, Russian, Spanish, Swedish).]]></comment>
                </field>
                <field id="custom" translate="label comment" type="select" sortOrder="70" showInDefault="0" showInWebsite="0" showInStore="1">
                    <label>Custom stemmer</label>
                    <source_model>Smile\ElasticsuiteCore\Model\Config\Source\Stemmers</source_model>
                    <comment><![CDATA[In the list "[default]" indicates the stemmer used by Elasticsuite by default for the language, while "[recommended]" indicates the stemmer is the one or one of those recommended for that language by Elasticsearch in its <a href='https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stemmer-tokenfilter.html#analysis-stemmer-tokenfilter-configure-parms' target='_blank'>online documentation</a>. Those can differ, hence this configuration parameter.]]></comment>
                    <depends>
                        <field id="use_default">0</field>
                    </depends>
                    <validate>required</validate>
                </field>
            </group>
        </section>

        <section id="smile_elasticsuite_autocomplete_settings" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Autocomplete</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Backend::smile_elasticsuite_autocomplete</resource>

            <group id="term_autocomplete" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Popular Term Autocomplete</label>
                <field id="max_size" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Max Size</label>
                    <validate>integer</validate>
                    <comment><![CDATA[Maximum number of popular search terms to display in autocomplete results.]]></comment>
                </field>
            </group>
        </section>

        <section id="smile_elasticsuite_misc_settings" translate="label" type="text" sortOrder="2000" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Miscellaneous</label>
            <tab>smile_elasticsuite</tab>
            <resource>Magento_Catalog::config_smile_elasticsuite_core_base_settings</resource>

            <group id="footer_settings" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Footer Settings</label>
                <field id="enable_es_link" translate="label comment" type="select" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    <label>Display ElasticSuite link</label>
                    <comment>Select Yes if you want to display an ElasticSuite copyright link in the footer.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
        </section>
    </system>
</config>