A comprehensive guide for implementing fast, typo-tolerant search using Typesense with Magento 2 and Adobe Commerce, including Hyvä theme compatibility.
Typesense is a modern, developer-friendly search engine that delivers sub-50ms search results with advanced features like typo tolerance, faceted search, and intelligent ranking. This integration provides a powerful alternative to Elasticsearch, Algolia, and default Magento search functionality.
- ⚡ Lightning Fast: Sub-50ms search response times
- 🧠 Intelligent: Machine learning-powered with typo tolerance
- 💰 Cost-Effective: Especially with self-hosting options
- 👨💻 Developer-Friendly: Simple API and intuitive configuration
- 🔧 Easy Maintenance: Minimal operational overhead compared to Elasticsearch
- Purpose: Base Typesense integration for standard Magento themes
- Price: $49.00
- Source: Ceymox Typesense Magento Extension
- Key Features:
- Instant, typo-tolerant search results
- Keyword-specific filtering
- Advanced search facets
- RESTful API integration
- Purpose: Enhanced Typesense integration optimized for Hyvä themes
- Price: $149.00
- Source: Ceymox Typesense Hyvä Module
- Key Features:
- Full Hyvä theme compatibility
- Advanced grouping and sorting
- Alpine.js integration
- Tailwind CSS styling support
┌─────────────────────────────────────────────────────────────────────────────┐
│ TYPESENSE MAGENTO 2 ARCHITECTURE │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────┐ ┌─────────────────┐ ┌──────────────────────────────┐
│ MAGENTO 2 │ │ TYPESENSE │ │ DEPLOYMENT OPTIONS │
│ FRONTEND │ │ EXTENSIONS │ │ │
│ │ │ │ │ ┌─────────────────────────┐ │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ │ OPTION 1: CLOUD │ │
│ │Search Field │ │ │ │ Base │ │ │ │ │ │
│ │Autocomplete │◄┼────┼►│ Extension │ │ │ │ ┌─────────────────────┐ │ │
│ │Results Page │ │ │ │ │ │ │ │ │ Typesense Cloud │ │ │
│ └─────────────┘ │ │ └─────────────┘ │ │ │ │ - Managed Service │ │ │
│ │ │ ┌─────────────┐ │ │ │ │ - Auto Scaling │ │ │
│ ┌─────────────┐ │ │ │ Hyvä │ │ │ │ │ - 24/7 Support │ │ │
│ │Hyvä Theme │ │ │ │ Module │ │ │ │ └─────────────────────┘ │ │
│ │Components │◄┼────┼►│ (Optional) │ │ │ │ │ │
│ └─────────────┘ │ │ └─────────────┘ │ │ └─────────────────────────┘ │
└─────────────────┘ └─────────────────┘ │ │
│ │ │ ┌─────────────────────────┐ │
│ │ │ │ OPTION 2: SELF-HOST │ │
▼ ▼ │ │ │ │
┌─────────────────────────────────────────┐ │ │ ┌─────────────────────┐ │ │
│ DATA FLOW │ │ │ │ Your Server + │ │ │
│ │ │ │ │ Proxy Setup │ │ │
│ ┌─────────────┐ ┌─────────────────┐ │ │ │ │ - Custom Config │ │ │
│ │ Magento │ │ Typesense │ │ │ │ │ - Full Control │ │ │
│ │ Database │ │ Collections │ │ │ │ │ - Cost Effective │ │ │
│ │ │ │ │ │ │ │ └─────────────────────┘ │ │
│ │ ┌─────────┐ │ │ ┌─────────────┐ │ │ │ │ │ │
│ │ │Product │ │ │ │ products │ │ │ │ └─────────────────────────┘ │
│ │ │Category │►┼─►│ │ categories │ │ │ └──────────────────────────────┘
│ │ │CMS Page │ │ │ │ pages │ │ │
│ │ │ │ │ │ │ suggestions │ │ │
│ │ └─────────┘ │ │ └─────────────┘ │ │
│ └─────────────┘ └─────────────────┘ │
│ │
│ Indexing Process: │
│ php bin/magento indexer:reindex │
│ ├── typesense_products │
│ ├── typesense_categories │
│ ├── typsense_pages │
│ └── suggestions │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ USER SEARCH JOURNEY │
└─────────────────────────────────────────────────────────────────────────────┘
User Types → Frontend Processes → Typesense API → Results Display
│ │ │ │
▼ ▼ ▼ ▼
┌─────────┐ ┌──────────────┐ ┌─────────────────┐ ┌──────────┐
│ "shirt" │ │ Autocomplete │ │ Search Request │ │ Instant │
│ "shrit" │─►│ Suggestions │─►│ + Typo Fix │─►│ Results │
│ "shurt" │ │ (Visual │ │ + Facet Filter │ │ < 50ms │
└─────────┘ │ Facade) │ │ + Ranking │ └──────────┘
└──────────────┘ └─────────────────┘
Best for: Production environments, teams preferring managed infrastructure
- Pricing: Pay-per-use model - Calculate costs
- Benefits:
- ✅ Zero maintenance overhead
- ✅ Automatic scaling and backups
- ✅ Global CDN and multi-region support
- ✅ 24/7 professional support
- ✅ SSL/TLS encryption included
- Setup: Simple API key configuration
Best for: Budget-conscious projects, custom requirements, data sovereignty needs
- Cost: Free Typesense license + your server costs
- Benefits:
- ✅ Complete control over infrastructure
- ✅ Custom configurations possible
- ✅ No per-search pricing
- ✅ Data stays on your servers
- Requirements:
- Your own server infrastructure
- Proxy configuration for API communication
- Manual maintenance and updates
- Installation Guide: Typesense Self-Hosting Documentation
Recommendation: 2 CPUs, 3 GB RAM with maxcluster's professional hosting
- Register at Typesense Cloud
- Create cluster and obtain API credentials
- Note your cluster URL and API key
- Install Typesense on your server
- Configure proxy server for API communication
- Set up security and firewall rules
Navigate to: Admin Panel > Stores > Configuration > Typesense Search > General
Configuration Settings:
- Enable Search:
Yes
- Search-only (public) API key: Your Typesense API Key
- Cloud Key:
- Cloud: Use your actual API key
- Self-hosted: Any random value (required by extension)
- Index Name Prefix: Unique identifier for your store
- Nodes: Your Typesense endpoint
- protocol: https
- Port: 443
# Save and refresh configuration
php bin/magento cache:flush
php bin/magento cache:clean config
# Index all search data to Typesense
php bin/magento indexer:reindex typesense_categories typesense_products typsense_pages suggestions
Note: Indexing time depends on catalog size. Monitor progress and ensure adequate server resources.
- ✅ Verify Typesense collections are created
- ✅ Test frontend search functionality
- ✅ Confirm autocomplete suggestions work
- ✅ Test faceted search and filtering
- ✅ Validate typo tolerance features
Problem: Search results page layout breaks when using Magento's default search page instead of Typesense's custom layout.
Root Cause: Extension overrides default Magento search layouts.
Solution: Create layout overrides in your theme to revert to default Magento 2 state.
<!-- Example layout override -->
<!-- app/design/frontend/[Vendor]/[Theme]/Ceymox_TypesenseSearch/layout/override/base/catalogsearch_result_index.xml -->
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
<!-- <referenceBlock name="breadcrumbs" remove="true" />-->
<!-- <referenceBlock name="page.main.title" display="false"/>-->
<!-- <referenceContainer name="columns.top">-->
<!-- <block ifconfig="typesense_search_result/instant_search_result/enable_result_page" class="Magento\Framework\View\Element\Template" name="typesense.loader" template="Ceymox_TypesenseSearch::loader.phtml" />-->
<!-- </referenceContainer>-->
<!-- <move element="catalog.compare.sidebar" destination="sidebar.main" />-->
<!-- <move element="wishlist_sidebar" destination="sidebar.main" />-->
<!-- <referenceBlock name="search.result">-->
<!-- <action ifconfig="typesense_search_result/instant_search_result/enable_result_page" method="setTemplate">-->
<!-- <argument name="template" xsi:type="string">Ceymox_TypesenseSearch::search/result.phtml</argument>-->
<!-- </action>-->
<!-- </referenceBlock> -->
<!-- <referenceBlock name="catalogsearch.leftnav">-->
<!-- <action ifconfig="typesense_search_result/instant_search_result/enable_result_page" method="setTemplate">-->
<!-- <argument name="template" xsi:type="string">Ceymox_TypesenseSearch::search/layer/view.phtml</argument>-->
<!-- </action>-->
<!-- <arguments>-->
<!-- <argument name="view_model"-->
<!-- xsi:type="object">Ceymox\TypesenseSearch\ViewModel\General</argument>-->
<!-- </arguments>-->
<!-- </referenceBlock>-->
</body>
</page>
Problem: Typesense scripts loading on every page can impact initial page load performance.
Root Cause: JavaScript libraries loaded regardless of search usage.
Solution: Implement visual facade pattern - load Typesense scripts only when search functionality is actively used.
Implementation Strategy:
- Create lightweight placeholder for search field
- Load full Typesense functionality on first search interaction
- Use lazy loading for autocomplete suggestions
- Implement proper caching strategies
- Visual Facade: Load search scripts only when needed
- Lazy Loading: Implement progressive loading for search suggestions
- Caching: Leverage browser caching for search assets
- Debouncing: Limit API calls during rapid typing
- Indexing Strategy: Schedule reindexing during low-traffic periods
- Memory Management: Allocate sufficient PHP memory for indexing
- Database Optimization: Ensure proper indexing on source tables
- Monitoring: Set up performance monitoring and alerting
- CDN: Use content delivery networks for static assets
- Caching Layers: Implement Redis/Varnish for full-page caching
- Server Resources: Optimize CPU and memory allocation
- Load Balancing: Distribute traffic across multiple instances
# Check indexer status
php bin/magento indexer:status
# Reset and reindex specific indexers
php bin/magento indexer:reset typesense_products
php bin/magento indexer:reindex typesense_products
# Monitor logs
tail -f var/log/typesense.log
tail -f var/log/system.log
tail -f var/log/debug.log
Issue | Symptoms | Solution |
---|---|---|
No Search Results | Empty search results despite indexed data | Check API credentials and server connectivity |
Slow Indexing | Indexing process times out or fails | Increase PHP memory_limit and max_execution_time |
Layout Problems | Search page displays incorrectly | Override extension layout files |
Autocomplete Not Working | No suggestions appear | Verify JavaScript loading and API responses |
Performance Issues | Slow page load times | Implement lazy loading and caching |
- Typesense Docs: https://typesense.org/docs/
- Magento DevDocs: https://devdocs.magento.com/
- Hyvä Documentation: https://hyva.io/documentation
- Ceymox Support: Available through their official website
- Typesense Community: GitHub discussions and Discord
- Magento Community: Stack Exchange, Forums, GitHub
For complex implementations or custom development needs, consider engaging:
- Certified Magento developers with Typesense experience
- Ceymox professional services team
- Specialized e-commerce agencies
- Extension licenses governed by Ceymox terms and conditions
- Typesense follows Apache 2.0 license for open-source version
- This documentation provided under MIT license
- Please review individual component licenses before production use
- Purchase required Ceymox extensions
- Choose deployment method (Cloud vs Self-hosted)
- Install and configure extensions
- Set up Typesense backend infrastructure
- Configure Magento admin settings
- Run initial data indexing
- Test search functionality thoroughly
- Implement performance optimizations
- Monitor and maintain system health
Happy Searching! 🔍
Last Updated: 2025 | For the latest updates and advanced configuration options, refer to the official Ceymox documentation and Typesense guides.