-
Notifications
You must be signed in to change notification settings - Fork 342
Extending
The goal of this part is to list the most common extension points of Elasticsuite and how they can be used by developers to fit their needs.
You are able to add special attributes to rules by doing it via the code.
Attributes added like this will be available for virtual categories and optimizers.
The entry point for these attributes will be the DI first :
<!-- Add the default Elasticsuite Special Attributes. -->
<type name="Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\SpecialAttributesProvider">
<arguments>
<argument name="attributes" xsi:type="array">
<item name="has_image" xsi:type="object">Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\SpecialAttribute\HasImage</item>
<item name="stock.is_in_stock" xsi:type="object">Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\SpecialAttribute\IsInStock</item>
<item name="price.is_discount" xsi:type="object">Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\SpecialAttribute\IsDiscount</item>
</argument>
</arguments>
</type>
You can add a new attribute here, and then you will have to implement it's object.
The object must implements \Smile\ElasticsuiteCatalogRule\Api\Rule\Condition\Product\SpecialAttributeInterface
.
The most complex part to implement is the getSearchQuery()
method. You can find additional method about how you are supposed to build a search query in the Querying part.
Do not hesitate to inspire from the default Elasticsuite special attributes.
When installing Elasticsuite, you will have by default all attributes data indexed into Elasticsearch. But you may wonder how you are supposed to add data coming from elsewhere to the index.
To achieve this, you should read carefully the Indexing - Data Sources part which is explaining how it's done and how you can extend it.
-
User's Guide
-
Developer's Guide
-
Releases
- Magento 2.3.x
- Magento 2.2.x
- Magento 2.1.x
- ElasticSuite 2.5.15
- ElasticSuite 2.5.14
- ElasticSuite 2.5.13
- ElasticSuite 2.5.12
- ElasticSuite 2.5.11
- ElasticSuite 2.5.10
- ElasticSuite 2.5.9
- ElasticSuite 2.5.8
- ElasticSuite 2.5.7
- ElasticSuite 2.5.6
- ElasticSuite 2.5.5
- ElasticSuite 2.5.4
- ElasticSuite 2.5.3
- ElasticSuite 2.5.2
- ElasticSuite 2.5.1
- ElasticSuite 2.5.0
- ElasticSuite 2.4.6
- ElasticSuite 2.4.5
- ElasticSuite 2.4.4
- ElasticSuite 2.4.3
- ElasticSuite 2.4.2
- ElasticSuite 2.4.1
- ElasticSuite 2.4.0
- ElasticSuite 2.3.10
- ElasticSuite 2.3.9
- ElasticSuite 2.3.8
- ElasticSuite 2.3.7
- ElasticSuite 2.3.6
- ElasticSuite 2.3.5
- ElasticSuite 2.3.4
- ElasticSuite 2.3.3
- ElasticSuite 2.3.2
- ElasticSuite 2.3.1
- ElasticSuite 2.3.0
- Magento 2.0.x