elasticsuite: Upgrade to Magento 2.4.5-p3 using OpenSearch 1.2 gets some errors

Upgrade to Magento 2.4.5-p3 using OpenSearch 1.2 gets some errors I get this error when trying to run indexer Element ‘datasources’: This element is not expected. Expected is ( mapping ).

If I remove the datasources attribute, it runs without error, but cannot create any searchable documents. I compare it with the older version, using ElasticSearch 5.6 the system can create 144,872 searchable documents, but after upgrade it using OpenSearch 1.2 it only creates 34 searchable documents.

Here is my elasticsuite_indices.xml `<indices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Smile_ElasticsuiteCore:etc/elasticsuite_indices.xsd">

<index identifier="catalog_product" defaultSearchType="product">
    <type name="product" idFieldName="entity_id">
        <!-- <datasources>
            <datasource name="prices">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\PriceData</datasource>
            <datasource name="categories">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\CategoryData</datasource>
            <datasource name="attributes">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\AttributeData</datasource>
            <datasource name="stock">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\InventoryData</datasource>
            <datasource name="keywords">WD\Elasticsearch\Model\Product\Indexer\Fulltext\Datasource\KeywordData</datasource>
        </datasources> -->
        <mapping>
            <!-- Static fields handled by the base indexer (not datasource) -->
            <field name="entity_id" type="integer" />
            <field name="attribute_set_id" type="integer" />
            <field name="has_options" type="boolean" />
            <field name="required_options" type="boolean" />
            <field name="created_at" type="date" />
            <field name="updated_at" type="date" />
            <field name="approval_date" type="date" />
            <field name="type_id" type="keyword" />
            <field name="sku" type="string" />
            <field name="visibility" type="integer" />
            <field name="children_ids" type="integer" />
            <field name="configurable_attributes" type="keyword" />

            <!-- Static fields handled by the "prices" datasource -->
            <field name="price.price" type="double" nestedPath="price"/>
            <field name="price.original_price" type="double" nestedPath="price"/>
            <field name="price.is_discount" type="boolean" nestedPath="price"/>
            <field name="price.has_tier_price" type="boolean" nestedPath="price"/>
            <field name="price.has_sales" type="boolean" nestedPath="price"/>
            <field name="price.customer_group_id" type="integer" nestedPath="price"/>

            <!-- Static fields handled by the "stock" datasource -->
            <field name="stock.is_in_stock" type="boolean" />
            <field name="stock.qty" type="integer" />

            <!-- Static fields handled by the "prices" datasource -->
            <field name="category.category_id" type="integer" nestedPath="category" />
            <field name="category.position" type="integer" nestedPath="category" />
            <field name="category.is_parent" type="boolean" nestedPath="category" />
            <field name="category.name" type="keyword" nestedPath="category">
                <isSearchable>1</isSearchable>
                <isUsedInSpellcheck>1</isUsedInSpellcheck>
                <isFilterable>0</isFilterable>
            </field>

        </mapping>
    </type>
</index>
</indices> `

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 45

Most upvoted comments

hi @vahonc,

sorry for late reply, let me try using elasticsuite 2.10.x first

regards

Hi @matiuskm

The datasources have been moved in 2.8.0 version : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog/etc/di.xml#L339

We had some backward compatibilities during some time but these have been removed.

So please move your datasources to di.xml file.

Regards