Magento Search: Hidden Elasticsearch Settings Affecting Your Results
Hidden Elasticsearch settings can impact Magento search. Adjust key settings to improve accuracy and performance.
magento search
19507
wp-singular,post-template-default,single,single-post,postid-19507,single-format-standard,wp-custom-logo,wp-theme-burst,theme-burst,mkd-core-2.1.2,woocommerce-no-js,ajax_fade,page_not_loaded,,burst-ver-3.5, vertical_menu_with_scroll,smooth_scroll,woocommerce_installed,blog_installed,wpb-js-composer js-comp-ver-6.9.0,vc_responsive,elementor-default,elementor-template-full-width,elementor-kit-11943,elementor-page elementor-page-19507,elementor-page-12697

Magento Search: Hidden Elasticsearch Settings Affecting Your Results

magento search

Magento 2’s search functionality is pretty powerful, especially with Elasticsearch driving the engine. But if you’ve ever wondered why your Magento search results aren’t as accurate or fast as you’d like, the issue might be lurking in some hidden settings you haven’t explored yet.

In this article, we’ll uncover those lesser-known Elasticsearch settings that could be impacting your Magento search performance and show you how to fine-tune them for optimal results.

Why Magento Search Can Be Tricky

Out of the box, Magento search seems straightforward. You type a product name, SKU, or keyword, and voila—results appear. But under the hood, Magento relies on Elasticsearch to handle:

  • Full-text searches
  • Autocomplete suggestions
  • Layered navigation filters

Elasticsearch works by indexing your product data and running complex queries to fetch relevant results. But here’s the catch: the default Magento search configuration isn’t optimized for every store. This is especially true if you have a large product catalog, complex SKUs, or multilingual content.

magento search

1. Query Type: 'LIKE' vs. 'MATCH'

Magento’s search queries can be configured to use different types of query methods, and this choice can significantly affect your results.

How It Affects Search:

  • LIKE Queries: Perform basic wildcard searches, which are fast but not very precise.
  • MATCH Queries: Use Elasticsearch’s full-text search capabilities, offering more relevant results but requiring more resources.

How to Check and Modify:

  • Go to Stores > Configuration > Catalog > Catalog Search.
  • Look for Search Engine and select Elasticsearch.
  • Under Search Options, adjust the Query Type.

For most stores, switching from LIKE to MATCH can improve result accuracy.

2. Minimum Should Match (MSM) Setting

This Elasticsearch setting controls how many of the search terms must match a document for it to be considered relevant.

Why It Matters:

  • A high MSM value can make searches too strict, missing products that are still relevant.
  • A low MSM value can flood search results with loosely related items.

How to Optimize:

  • In Catalog Search settings, look for Minimum Should Match.
  • Start with 70% and tweak based on how strict or lenient you want the search to be.

Pro Tip:

For product names with multiple words, reducing the MSM slightly can help Magento search return more comprehensive results.

3. Stop Words Filter

Elasticsearch uses stop words (common words like “and,” “or,” “the”) to improve performance by ignoring them during searches. However, this can backfire if your product names rely on these words.

The Issue:

Imagine a product named “The One Phone”. If “the” is a stop word, Magento search might not find this product when users search for “The One.”

Fix It:

  • Go to your Elasticsearch configuration files or use an extension to manage stop words.
  • Remove stop words that are relevant to your product catalog.

Advanced Tip:

You can create a custom stop words list tailored to your industry, improving search relevance without sacrificing performance.

4. Analyzer and Tokenizer Settings

Elasticsearch breaks down text using analyzers and tokenizers, which affect how search queries are processed.

Why It Matters:

  • Standard Tokenizer: Splits text into basic tokens (words).
  • Whitespace Tokenizer: Only splits on spaces, useful for SKU searches.
  • Custom Tokenizers: Allow you to handle complex cases like hyphenated SKUs.

How to Customize:

  • Modify Elasticsearch’s configuration (elasticsearch.yml) or through the Magento admin panel with advanced extensions.
  • Experiment with different analyzers, like edge_ngram for autocomplete functionality.

Example:

If your SKUs are like ABC-123, using a whitespace tokenizer instead of the standard one can improve Magento search for partial matches like 123.

5. Search Weight for Attributes

Magento allows you to assign different weights to product attributes, determining which ones are prioritized in search results.

Why It’s Important:

If every attribute has the same weight, irrelevant products might appear higher in search results.

How to Adjust Weights:

  • Go to Stores > Attributes > Product.
  • Edit the attribute (like Name, SKU, Description).
  • Under Storefront Properties, adjust the Search Weight.

Optimization Tip:

Give higher weight to product names and SKUs, and lower weight to long descriptions or metadata.

6. Fuzzy Search Configuration

Fuzzy search helps when users make typos or misspellings, which is common in eCommerce.

Why It Matters:

Without fuzzy search, “iphnoe” won’t return results for “iPhone.”

How to Enable:

  • In Catalog Search settings, enable Fuzzy Search.
  • Adjust the Fuzziness Level (0 = exact matches, 1 or 2 allows for typos).

Quick Tip:

Don’t set fuzziness too high—it can return irrelevant results. A setting of 1 is usually a good balance.

7. Synonyms for Better Search Relevance

Magento search can be improved dramatically with the right synonym mapping.

Real-World Example:

If customers search for “laptop,” but your products are listed as “notebooks,” they might miss key products.

How to Add Synonyms:

  • Go to Stores > Configuration > Catalog > Catalog Search.
  • Add synonyms like laptop, notebook, ultrabook.
  • Reindex your site:
				
					php bin/magento indexer:reindex
				
			

Pro Tip:

Regularly review search query reports to find terms customers use that don’t match your product catalog.

8. Query Relevance Tuning with Advanced Search Extensions

Sometimes Magento’s native search settings aren’t enough. That’s where advanced search extensions come in handy.

Top Extensions to Consider:

  • Mirasvit Advanced Search: Provides more control over search behavior, including custom ranking algorithms.
  • Amasty Elastic Search: Offers enhanced filtering, synonym management, and better relevance scoring.
  • Algolia for Magento: For lightning-fast search with AI-powered ranking algorithms.

Performance Considerations

Optimizing Magento search isn’t just about relevance; speed matters too. According to Google, a one-second delay in load time can reduce conversions by up to 20%.

Quick Performance Tips:

  • Optimize Elasticsearch heap size.
  • Use caching with Redis or Varnish.
  • Regularly clean up and optimize your Magento database.

Final Thoughts

Magento search is more than just a simple box where customers type queries. Underneath, Elasticsearch handles complex indexing, tokenizing, and querying operations. By tweaking these hidden settings—from query types to attribute weights and custom analyzers—you can dramatically improve both the accuracy and performance of your Magento search.

Regularly monitor search analytics, experiment with different configurations, and don’t be afraid to dive into Elasticsearch logs when things get tricky. A well-optimized search isn’t just good for UX; it’s a direct path to higher conversions.

Got a Magento search tip or trick that worked wonders for you? Share your thoughts—we’d love to hear them!

Experience Seamless E-commerce with 5MS

5MS delivers expert Magento services to enhance your store’s capabilities and customer experience.

Page Load Time of under 0.3 seconds!

12+

Years on average of clients staying with us

15+

Years of experience

Want to experience fastest and most reliable Magento Support?