Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
760 stars 336 forks source link

Catalog Search Reindex not working after 247 upgrade #3271

Closed sethkgx closed 1 month ago

sethkgx commented 1 month ago

Preconditions

Magento Version : 247 EE (Adobe Commerce)

ElasticSuite Version : 2.11.6.1

Environment : Developer

Third party modules : N/A

Steps to reproduce

  1. Upgrade to Magento 247
  2. Do Reindex

Expected result

  1. Reindex successfully, products showing in the frontend

Actual result

  1. Reindex encountered an error Screenshot 2024-05-07 at 13 41 58
rbayet commented 1 month ago

Hello @sethkgx,

From which version of Magento + Elasticsuite did you made the upgrade from ?

Regards,

sethkgx commented 1 month ago

Hi @rbayet We were on Magento 2.4.5-p2 and using version 2.10.0 of ElasticSuite

vahonc commented 1 month ago

Hi @sethkgx,

What is the full stack of this error message? You can find it in the Magento logs (exception.log or system.log) and maybe in Elasticsearch logs (/var/log/elasticsearch/).

Also, have you tried to deselect ElasticSuite as the default search engine, e.g. back to Elasticsearch 7 and try run reindex again?

BR, Vadym

sethkgx commented 1 month ago

Hi @vahonc

There is no log unfortunately, that's why it's hard to debug what file or what's causing the reindex error. We can't go back to Elasticsearch 7 because this is no longer supported in Magento 247.

Ideally, we still want to use ElasticSuite because there's some customisations we've done already in the module.

vahonc commented 1 month ago

@sethkgx

In Magento 2.4.7 they remove the Magento_Elasticsearch module (for Elasticsearch 5) and add support for Elasticsearch 8. Yes, the Magento_Elasticsearch7 module is being deprecated because Elasticsearch 7 reached end-of-life in August 2023. However, it is still the default option for 2.4.7 so you can still use them.

As for this:

Also, have you tried to deselect ElasticSuite as the default search engine, e.g. back to Elasticsearch 7 and try run reindex again?

I mean try temporary select Elasticsearch 7 as the default search engine here:

Screenshot from 2024-05-10 11-41-18

and try to run reindex and check if errors will still be present.

I have a test environment with Magento 2.4.7 with default sample data, Elasticsearch 7.17.20 and ElasticSuite 2.11.6.1. I don't have any errors during reindex, so probably your issue is quite specific to your project/environment.

If you don't want to use Elasticsearch 7 you can install the Opensearch, ElasticSuite also supports it.

BR, Vadym

rbayet commented 1 month ago

Hello @sethkgx,

The error seems to be generated on the server side by your OpenSearch/Elasticsearch instance, it's a java.util.regex.PatternSyntaxException related to having unescaped characters "[" and/or "]" inside a regex character class. The "near index 1" means that you have probably somewhere in your configuration a string "[]" that is interpreted by the search engine as a regex.

The only place I can think of might be related to the recently introduced token filters to remove trailing/leading zeroes from SKUs. Have you enabled any of the settings in Stores > Configuration > Elasticsuite > Analyzer settings ?

Also, could you provide us the results of the following commands executed in your magento directory ? composer info | grep -i elasticsearch and composer info | grep -i opensearch

And also the exact flavour and version of your Elasticsearch or Opensearch server.

Regards,

github-actions[bot] commented 1 month ago

This issue was waiting update from the author for too long. Without any update, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.