Skip to content

ModuleInstallOld

Aurélien FOUCRET edited this page Feb 2, 2018 · 1 revision

Magento 2 Module Install

  • ⚠️ Deprecated documentation :
    • This documentation is suitable if you install old version of ElasticSuite. If you are using ElasticSuite >= 2.5.0, please refer to the new documentation page
  • ⚠️ ElasticSearch 5.x is not on older version of ElasticSuite. Please upgrade to ElasticSuite 2.5.0 if you want to use ElasticSearch 5.x

Requirements

  • ElasticSearch 2.1 or higher with :
    • Enabled scripting
    • ICU and Phonetic plugin installed
  • Depending the version of ElasticSuite :
ElasticSuite Version Magento required version
ElasticSuite 2.0.x Magento 2.0.x
ElasticSuite 2.1.x Magento 2.0.x
ElasticSuite 2.2.x Magento 2.1.x
ElasticSuite 2.3.x Magento 2.1.x
ElasticSuite 2.4.x Magento 2.2.x

In order to get a properly set up ElasticSearch server you should read the following page of the wiki ElasticSearch server configuration

Install ElasticSuite through composer :

composer require smile/elasticsuite

Enable the module and run ElasticSuite setup:

bin/magento module:enable Smile_ElasticsuiteCore Smile_ElasticsuiteCatalog Smile_ElasticsuiteSwatches Smile_ElasticsuiteCatalogRule Smile_ElasticsuiteVirtualCategory Smile_ElasticsuiteThesaurus Smile_ElasticsuiteCatalogOptimizer Smile_ElasticsuiteTracker
bin/magento setup:upgrade

⚠️ If your ElasticSearch instance is not on "localhost:9200", follow this guide.

Configure ElasticSearch server :

You can configure your ElasticSearch server via Stores > Configuration > Smile Elastic Suite > Base Settings

Client configuration

ElasticSearch Client

Parameter Default value Description
ElasticSearch servers list localhost:9200 This a comma-separated list of servers in the [host]:[port] format where you should indicate all your ElasticSearch nodes. E.g. : "es-node1.fqdn:9200, es-node2.fqdn:9200".
Use HTTPS No Enable this parameter if you want to access to your Elasticsearch server through https.
Enable basic HTTP authentication No Enable this one if your Elasticsearch server uses basic HTTP authentication
Basic HTTP authentication user empty If you are using HTTP authentication, set your user auth in this field.
Basic HTTP authentication password empty If you are using HTTP authentication, set your user password in this field.
Enable debug mode No When this parameter is set to "Yes", the module produces logs through the Magento logging system.
Server connection timeout 1 In seconds, the default timeout used when querying the server.

Indices Settings

Indices Settings

Parameter Default value Description
Indices alias name magento2 The default alias put by the module on Magento's related indices.

An alias per store and entity type will be generated with the following format : [indices_alias_name]_[store_code]_[entity_type].

E.g. : magento2_default_catalog_product.
Indices name pattern {{YYYYMMdd}}_{{HHmmss}} The horodated pattern used when creating new index.

An index name per store and entity type, based on the horodated pattern, will be generated with the following format : [indices_alias_name]_[store_code]_[entity_type]_[horodated_pattern].

The E.g. : magento2_default_catalog_product_20160304_094708.
Number of shards per index 1 The number of shards per index. A shard is a single Lucene instance and they are distributed by ElasticSearch amongst all nodes in the cluster.

You can see the Shard definition on the ElasticSearch glossary for more informations.
Number of replicas per index 0 The number of replicas shards per index. Main purposes of replica shards is for failover : if the node holding a primary shard dies, a replica is promoted to the role of primary.

You can read more about Replica Shards on the ElasticSearch documentation.

Configure ElasticSuite as Magento Search Engine :

You can configure Magento to use Smile ElasticSuite as search engine via Stores > Configuration > Catalog > Catalog Search

ES as Search Engine

Parameter Default value Description
Minimal Query Length 1 The minimal search query length to be processed by the engine.
Maximum Query Length 128 The maximum search query length to be processed by the engine.
Search Engine MySQL The default Search Engine used by Magento. Set it to Smile ElasticSuite to use it as Search Engine.

Process first indexing :

Once you have completed the 2 previous points, you can process a full reindexing of the catalogsearch_fulltext index.

bin/magento index:reindex catalogsearch_fulltext
bin/magento index:reindex elasticsuite_categories_fulltext
bin/magento index:reindex elasticsuite_thesaurus

Once the reindex is done, you are all set and can view your frontend catalog and search pages being rendered via Smile Elastic Suite !

Optional : Installing the module when using a custom ElasticSearch server location.

⚠️ If your ElasticSearch instance is on localhost:9200 you do not need to follow this step.

Your ElasticSearch server may be on a different host than localhost:9200. This typically occurs on a production environment where the ElasticSearch instance should be on a dedicated server.

To ensure the module will properly find your instance when installing, you may have a to add a MyProject_ElasticSuite module in your own project (into app/code) with the following content into the etc/config.xml file :

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <smile_elasticsuite_core_base_settings>
            <es_client>
                <servers>my_server:9200</servers>
            </es_client>
        </smile_elasticsuite_core_base_settings>
    </default>
</config>

Warning : if you want to be sure that configuration will be loaded in the right order and the new configuration will apply, your custom module should depends Smile_ElasticsuiteCore :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="MyProject_ElasticSuite" setup_version="1.0.0">
        <sequence>
            <module name="Smile_ElasticsuiteCore"/>
        </sequence>
    </module>
</config>
Clone this wiki locally