How to Set Up Site Search and Navigation
Overview
Why Site Search and Navigation Matter
- Help shoppers find products quickly and reduce bounce
- Increase conversion rates with intuitive navigation
- Reduce zero-results searches and improve discoverability
- Boost search-driven revenue by 3–8% with optimized relevance
Set up fast, accurate site search and intuitive navigation to help shoppers find products quickly, reduce bounce, and increase conversion. This how-to guides a growing merchant through configuring Magento's built-in search, filters (layered navigation), and menu-driven category navigation for measurable business impact.
KPI Targets:
Track search-to-product-view rate, zero-results rate, and conversion rate from search. Aim for under 10% zero-results rate and increased search-driven revenue after tuning. Reducing zero-results by 5 percentage points can lift search-driven revenue by 3–8% by salvaging high-intent sessions.
If metrics underperform: lower zero-results by adding synonyms and redirects for top queries; boost relevance by raising Search Weight for high-intent attributes (e.g., SKU, Brand); and reduce friction by enabling autocomplete and cleaning stop words.
Search Engine Compatibility:
Magento 2.4.0–2.4.3 require Elasticsearch 7.x. Magento 2.4.4–2.4.5 support OpenSearch 1.x and Elasticsearch 7.x. Magento 2.4.6+ support OpenSearch 2.x and Elasticsearch 7.17.x.
Prerequisites
Before you begin, make sure you have:
Admin Panel Access
Access to Magento Admin Panel
Search Engine Installed
Elasticsearch/OpenSearch installed and reachable from the web server
Admin Credentials
Permissions to change Catalog and Configuration settings
Cron Configured
Cron configured and running for scheduled indexing
CLI Access
Ability to flush caches and run reindex (CLI access recommended)
Network Access
Network access from web server to search cluster host and port (default 9200)
Quick Connectivity Test:
From the web server: curl -k https://HOST:PORT or curl http://HOST:PORT should return version info
What You'll Accomplish
By following this guide, you will:
- Configure and connect Elasticsearch/OpenSearch for site search
- Enable autocomplete, search suggestions, and recommendations
- Set up search synonyms and stop words for better relevance
- Enable layered navigation (filters) for categories and search results
- Build an intuitive category hierarchy for top navigation
- Monitor and optimize search performance with redirects and weight tuning
Step-by-Step Instructions
Select and save the search engine
Go to Stores › Configuration › Catalog › Catalog › Catalog Search. In Search Engine, select the supported engine for your Magento version (Elasticsearch 7 for 2.4.0–2.4.3; OpenSearch or Elasticsearch for 2.4.4+).
Configure the connection fields (labels vary by version):
- Server Hostname
- Server Port
- Index Prefix
- Enable SSL/Use HTTPS
- Enable HTTP Authentication (if required)
- Username and Password (if your cluster requires authentication)
- Timeout
Click Test Connection (if available), then click Save Config, and flush caches when prompted.
Tune core search behavior
In the same Catalog Search section:
- Set Minimum Query Length and Maximum Query Length
- Enable Search Suggestions = Yes to show "Did you mean" on the search results page, and set Search Suggestions Count (e.g., 5–10)
- Enable Search Recommendations = Yes to show "Related search terms" on the search results page, and set Search Recommendations Count
- Enable Search Autocomplete = Yes to show the dropdown while typing, and set Autocomplete Limit (also labeled "Maximum Number of Autocomplete Results" in some versions) to control how many items appear in the typing dropdown
Save.
Add search synonyms
Go to Marketing › SEO & Search › Search Synonyms. Select the Store View. Click Add Synonym Group. Enter comma-separated equivalents (e.g., tee, t-shirt, tshirt).
Also consider brand abbreviations (e.g., "NKB" → "Nike"), regional spellings ("colour" → "color"), and common misspellings to capture high-intent traffic. Save.
After you save: Reindex Catalog Search (System › Tools › Index Management › Catalog Search › Reindex Data) or wait for the next scheduled reindex.
Add stop words
Go to Marketing › SEO & Search › Stop Words. Select the Store View. Click Add New Stop Word, add common words to ignore (e.g., the, and), and Save.
After you save: Reindex Catalog Search or wait for the next scheduled reindex.
Boost relevance for key attributes
Go to Stores › Attributes › Product. Open high-intent attributes (e.g., Brand, SKU, Model). Under Storefront Properties, set Use in Search = Yes and raise Search Weight (e.g., 5–10 for Brand/SKU). Save each attribute.
Note: The Search Weight field appears only after setting Use in Search = Yes. Valid weights are 1 (lowest) to 10 (highest).
After you save: Reindex Product EAV and Catalog Search or wait for the next scheduled reindex.
Enable attributes for layered navigation
In Stores › Attributes › Product, open attributes you want as filters (Brand, Size, Color). For each attribute you want as a filter:
- Catalog Input Type = Dropdown, Multiple Select, Visual Swatch, or Text Swatch
- Scope = Global
- Storefront Properties: Use in Layered Navigation = Filterable (with results)
- Optional: Use in Search Results Layered Navigation = Yes
- Save
Important: Global Scope Required
For an attribute to be used in layered navigation, its Scope must be Global (Stores › Attributes › Product › [Attribute] › Properties › Scope = Global). If set to Website or Store View, layered navigation options are unavailable.
Product data readiness checklist:
- Add the attribute to all relevant Attribute Sets (Stores › Attributes › Attribute Set)
- Ensure products in the category have non-empty values for the attribute in the current Store View
- Reindex Category Products and Product EAV
Optional global settings:
Go to Stores › Configuration › Catalog › Catalog › Layered Navigation. Set Price Navigation Step Calculation (Automatic or Manual), Price Navigation Step, and Display Product Count = Yes to show counts next to filters. Save.
After you save: Reindex Product EAV and Category Products or wait for the next scheduled reindex.
Turn on layered navigation per category
Go to Catalog › Categories. Select a main category. Under Display Settings, set Is Anchor = Yes. Save. Repeat for key categories.
Note: Filters show only if products in the category have values for the filterable attributes and there are at least two distinct values. Verify attribute scope and values for the current Store View.
After you save: Reindex Category Products or wait for the next scheduled reindex.
Build a clear category hierarchy for top navigation
Do:
- Create or reorganize 6–10 top-level categories under your store's root category
- For each category: set Is Active = Yes and Include in Menu = Yes
- Add 1–2 levels of subcategories where needed
- Use the Position field to control order
- If you create a new root category, assign it at Stores › All Stores › (Your Store) › Root Category so it appears in the store's top navigation
- Save
Best Practices
- Use shopper-friendly labels (e.g., "Men", "Women", "Sale") and limit top-level items to 5–8 for scannability
- Place highest-margin or seasonal categories first
- Track header menu click-through rate (CTR) and revenue per category in your analytics, then reorder monthly to surface highest-CTR or highest-margin categories
Why this matters: Reordering top navigation can shift 2–5% more traffic to profitable categories
Set category display mode and sorting
Still in Catalog › Categories, for each major category under Display Settings, set Display Mode to Products Only or Static Block and Products. Under Display Settings, set Default Product Listing Sort By and Available Product Listing Sort By.
Set Default Product Listing Sort By to Position, Product Name, or Price (the options available out of the box).
Note: Relevance applies only to search results. Best Sellers requires a custom attribute or an extension.
Save.
Reindex and refresh caches
Ensure cron is running and indexers are set to Update by Schedule. If needed, go to System › Tools › Index Management, select the relevant indexers, choose Reindex Data, and Submit.
Reindex Guidance
- After synonyms/stop words/search settings: Catalog Search
- After attribute changes (Use in Search, Search Weight, Layered Navigation): Product EAV, Catalog Search
- After category Is Anchor and hierarchy changes: Category Products
Then go to System › Cache Management and refresh Page Cache and Block HTML Output (or Flush Magento Cache if unsure).
Validate storefront search and filters
- On the storefront, perform searches for Brand, SKU, and a descriptive term. Check search suggestions ("Did you mean") and confirm relevant products appear
- Type the first 2–3 letters of a popular query and confirm the autocomplete dropdown shows up to the configured Autocomplete Limit
- Open a major category and apply 2–3 filters (Brand, Price, Size). Clear filters and repeat
Monitor search terms and optimize
After sufficient traffic (often within 24–72 hours), go to Reports › Marketing › Search Terms to analyze search term performance. To manage redirects or terms, go to Marketing › SEO & Search › Search Terms. Add synonyms or adjust attribute Search Weight as needed.
Note: Search Terms, Synonyms, and Stop Words are scoped per Store View. Review and optimize per storefront locale (use the store switcher at the top-left of each page).
Create high-impact redirects for common navigational queries:
- "sale" → /sale
- "gift card" → /gift-card
- "new" → /new-arrivals
- "clearance" → /outlet
For navigational or support queries (e.g., "returns", "size chart"), create Search Term entries with Redirect URLs to the appropriate CMS pages or category landing pages to improve conversion and reduce support contacts.
Why this matters: Systematic synonym/redirect updates on top 50 queries typically improve search conversion 5–15% over 60 days
Suggested 30/60/90-day Optimization Cadence
- Days 1–30: Fix zero-results queries; add synonyms for top 20 queries; enable autocomplete and tune Autocomplete Limit; raise Search Weight for SKU/Brand
- Days 31–60: Add redirects for navigational queries; expand synonyms to top 50 queries; prune stop words; validate layered navigation coverage on top categories
- Days 61–90: Review analytics, reorder top navigation by CTR/margin; A/B test Autocomplete Limit and suggestions count; refine attribute weights and filter set
Verification
To confirm everything is working correctly:
-
Search Functionality
- ✓ Run a search for a known SKU and confirm the product appears on the first results page
- ✓ Type the first 2–3 letters of a popular query and confirm the autocomplete dropdown shows up to the configured Autocomplete Limit
- ✓ On the search results page, confirm layered navigation appears if enabled for attributes
-
Category Navigation & Filters
- ✓ Open a major category and confirm filter facets (Brand, Price, Size) appear with product counts
- ✓ Confirm category pages respect the configured default sort (Position, Product Name, or Price)
-
Admin Verification
- ✓ Navigate to the admin panel and verify changes are visible and saved correctly
Common Issues and Solutions
Solution
- Verify Elasticsearch/OpenSearch service is running and reachable
- Check Stores › Configuration › Catalog › Catalog Search connection settings
- Reindex Catalog Search
- Check var/log/system.log and var/log/exception.log for connection errors
Solution
- Ensure category Is Anchor = Yes
- Attribute input type is Dropdown/Multiple Select/Visual Swatch/Text Swatch
- Scope = Global; Use in Layered Navigation = Filterable (with results)
- Attribute is in the correct Attribute Sets
- Products have attribute values
- Reindex Product EAV and Category Products; clear cache
Solution
- Confirm Store View selection matches storefront
- Reindex Catalog Search
- Clear caches
- Ensure synonyms are created for the correct Store View
Solution
- Verify search engine hardware resources
- Reduce Autocomplete Limit and Search Suggestions Count
- Ensure production mode and full-page cache are enabled
- Consider upgrading to OpenSearch on Magento 2.4.4+ if supported