<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="search">
            <group id="engine">
                <label>Search engine configuration</label>

                <field id="es_status" translate="label comment tooltip" type="text" sortOrder="70" showInDefault="1">
                    <button_label>Check the search engine status</button_label>
                    <comment><![CDATA[Verify the current status of the configured search engine to ensure it is running and accessible.]]></comment>
                    <frontend_model>Mirasvit\SearchElastic\Block\Adminhtml\Config\Form\Field\Command\Status</frontend_model>
                    <config_path>search/engine/es_status</config_path>
                    <depends>
                        <field id="engine" separator=",">elasticsearch8,opensearch,elasticsearch7,elasticsearch6,elasticsearch5</field>
                    </depends>
                </field>

                <group id="actions" translate="label comment" type="text" sortOrder="80" showInDefault="1">
                    <label>Search data reset</label>
                    <fieldset_css>mst_config_expanded</fieldset_css>
                    <comment><![CDATA[Deleting search indexes removes outdated or incorrect data, helps fix search issues, or applies configuration changes. Reindexing is required afterward to restore search functionality.]]></comment>
                    <depends>
                        <field id="engine" separator=",">elasticsearch8,opensearch,elasticsearch7,elasticsearch6,elasticsearch5</field>
                    </depends>

                    <field id="es_reset" translate="label comment tooltip" type="text" sortOrder="85" showInDefault="1">
                        <button_label>Delete all search indexes</button_label>
                        <comment><![CDATA[Removes all indexes from the current search engine connection.]]></comment>
                        <frontend_model>Mirasvit\SearchElastic\Block\Adminhtml\Config\Form\Field\Command\Reset</frontend_model>
                        <config_path>search/engine/es_reset</config_path>
                        <depends>
                            <field id="engine" separator=",">elasticsearch8,opensearch,elasticsearch7,elasticsearch6,elasticsearch5</field>
                        </depends>
                    </field>

                    <field id="es_reset_store" translate="label comment tooltip" type="text" sortOrder="85" showInDefault="1">
                        <button_label>Delete store-specific indexes</button_label>
                        <comment><![CDATA[Removes indexes associated with the current store(by index prefix configured for search engine in store settings).]]></comment>
                        <frontend_model>Mirasvit\SearchElastic\Block\Adminhtml\Config\Form\Field\Command\ResetStore</frontend_model>
                        <config_path>search/engine/es_reset_store</config_path>
                        <depends>
                            <field id="engine" separator=",">elasticsearch8,opensearch,elasticsearch7,elasticsearch6,elasticsearch5</field>
                        </depends>
                    </field>
                </group>
            </group>
        </section>

        <section id="searchautocomplete">
            <group id="general">
                <field id="fast_mode" translate="label comment tooltip" type="select" sortOrder="25"
                       showInDefault="1">
                    <label>Enable fast mode</label>
                    <comment><![CDATA[Speeds up autocomplete search. <i>Note:</i> This option increases the indexing time of the search index and is not available for the MySQL search engine.]]></comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <config_path>searchautocomplete/general/fast_mode</config_path>
                </field>
            </group>
        </section>
    </system>
</config>