Magento 2 + Elasticsearch + We can't find products matching the selection

Magento 2 + Elasticsearch + We can't find products matching the selection

July 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 + Elasticsearch + We can't find products matching the selection

Resolving “We can’t find products matching the selection” Error in Magento 2 + Elasticsearch

As an experienced e-commerce developer, I often encounter issues like this when integrating Magento 2 with Elasticsearch for product search functionality. Let’s dive into a step-by-step solution to resolve your problem.

Step 1: Verify Elasticsearch and Magento 2 Setup

Firstly, ensure that your Elasticsearch installation is running correctly on version 7.x. You can test the connection from the Magento admin panel by checking the “Test Connection” box in System > Configuration > Catalog > Search Engine Optimization > Use Elasticsearch.

Step 2: Check Indexing Status and Reindex All

Even though you mentioned reindexing, let’s verify that all required indexes are actually being created and updated. Open a new tab and navigate to System > Index Management. Under the “All indices” tab, ensure that the following indexes are present:

  • Catalog Product Flat 1
  • Catalog Category Flat Store 2
  • Catalog Rule Product
  • Catalog Search Index

If any of these are missing or have an error status, click on each index and select “Reindex data”. This will update the respective index with the current product and category information.

Step 3: Clear Cache and Check Configuration

Delete all cache files from pub/static, var/cache, and var/view_preprocessed folders. Also, flush the cache from the Magento admin panel under System > Tools > Cache Management. This will clear any previous configuration settings that might be causing conflicts.

Next, double-check your Elasticsearch configuration in System > Configuration > Catalog > Search Engine Optimization:

  • Set “Use Elasticsearch” to “1”.
  • Enter the correct Elasticsearch host (usually localhost for local development).
  • Specify the port number if it’s not 9200.
  • Ensure that the index prefix matches your Elasticsearch indices exactly.

Step 4: Delete and Recreate Elasticsearch Indices

If you’ve already tried deleting indices, let me clarify this step further:

  1. Log in to your Magento admin panel as an administrator.
  2. Navigate to System > Configuration > Catalog > Search Engine Optimization.
  3. Set “Use Elasticsearch” to “0”.
  4. Click on the “Save Config” button.
  5. Open a new terminal window and navigate to your Magento 2 project directory.
  6. Run this command: php bin/magento elasticsearch:status
  7. If any indices are still present, run this command to delete them all: php bin/magento elasticsearch:delete_indices

Step 5: Reinstall the Elasticsearch Extension

If you’re still facing issues after following these steps, it might be due to a faulty installation of the Elasticsearch extension. Here’s how to reinstall it:

  1. Open your Magento admin panel.
  2. Navigate to System > Configuration > Advanced > Dependency Resolution.
  3. Click on “Component Register”.
  4. Find the “Magento_Elasticsearch” component in the list, and click on it.
  5. Select “Uninstall” from the menu that appears.
  6. Confirm the action by clicking “Yes”.

After uninstalling:

  1. Navigate back to the main Components page.
  2. Click on “Add New Component”.
  3. Enter the following information:
    • Package Name: magento
    • Component Name: elasticsearch
  4. Click “Add Component”.
  5. Enable Elasticsearch again in System > Configuration > Catalog > Search Engine Optimization.

This should resolve your issue and allow Magento 2 to find products matching the selection using Elasticsearch.

Conclusion

Integrating Magento 2 with Elasticsearch requires careful configuration and management of indices. By following these steps, you can ensure that your product search functionality works seamlessly with Elasticsearch. If you’re still facing issues after trying this guide, feel free to reach out or explore more resources on Laravel Company.

Remember, keeping your Magento 2 setup up-to-date and using the latest stable versions of both Magento and Elasticsearch can prevent many compatibility issues in the long run. Happy coding!

Magento 2 Catalog Cache Indexing

Our network