1

I regularly see products disappear from Magento storefront categories with message: "We can't find products matching the selection".

After manually running indexer:reindex, then cache:flush products re-appear -- only to disappear hours later AGAIN.

I have a clean Magento 2.3 and a 2.4.2 install. Products are added manually. Stocks are correct. I don't see any issue with ElasticSearch (don't think ElasticSearch has anything to do with it). CRON runs every minute. Products are associated with the right site and respective categories. I'm running PLESK on Ubuntu. CRON is running via PHP 7.3 for Mage 2.3 and PHP 7.4 for Mage 2.4.2

Any help would be greatly appreciated.

4
  • I have same issue and fixed after disable Amasty Visual Merchandiser? Jun 25, 2021 at 2:41
  • another lots of possible reason behind it. Jun 25, 2021 at 2:43
  • 1
    What's your indexer mode, change that to schedule.
    – Sohel Rana
    Jun 25, 2021 at 5:21
  • Hi everyone. As I pointed out .. the answer is that I manage multiple Magento's which all use the same ElasticSearch server. So, each Magento site's ElasticSearch setting needs to have a UNIQUE PREFIX (Change the default "Magento2" Prefix to a different unique name. This keeps each Magento website's request to the ElasticSearch server unique and clear. Otherwise, the data overlaps and corrupts. See my detailed answer below.
    – Ray
    Jun 30, 2021 at 20:57

1 Answer 1

1

If you're running multiple e-commerce sites on the same server and all are using the the same Elastic Search server instance, you will need to enter a unique index name in the Elastic Search config field inside each Magento. If you don't do this, of course, the Search Index will not distinguish between each site (user) and will eventually fail to properly index ... thus causing the search index to corrupt.

So the solution is

  1. Add a unique Index Name to Each Site's Elastic Search Setup: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search. From the Search Engine list, select your Elasticsearch version and Change the Magento2 prefix to your own unique index name for the site.

  2. Update configuration, index and cache

full docs: https://devdocs.magento.com/guides/v2.4/config-guide/elasticsearch/configure-magento.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.