amadeco / module-elasticsuite-blog-search
Comwrap Elasticsuite - Blog Post Search Module for Smile Elasticsuite.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 15
Open Issues: 0
Type:magento2-module
Requires
- magento/framework: >=100.1.0
- magento/magento-composer-installer: *
- magento/module-backend: >=100.1.0
- magento/module-catalog: >=100.1.0
- magento/module-catalog-search: >=100.1.0
- magento/module-store: >=100.1.0
- smile/elasticsuite: >=2.1
Requires (Dev)
This package is auto-updated.
Last update: 2025-07-03 17:56:31 UTC
README
This module extends Smile ElasticSuite to integrate Magefan Blog posts into the search engine, providing a unified search experience across products and blog content.
Features
- Blog Post Search Integration: Seamlessly indexes blog posts into ElasticSearch
- Autocomplete Support: Shows blog posts in search autocomplete suggestions
- Dedicated Search Results: Displays blog posts on the search results page
- Full-Text Search: Searches through blog titles and content
- Smart Filtering: Only shows active and searchable blog posts
- Multi-Store Support: Respects store-specific blog post visibility
- SEO Optimized: Helps users discover relevant blog content alongside products
Screenshots
Autocomplete Integration
Blog posts appear in the search autocomplete dropdown with a dedicated "News" section:
🔍 Search: "installation guide"
├── Products (3)
├── Categories (1)
└── News (2)
├── How to Install Your New Kitchen
└── Installation Tips & Tricks
Search Results Page
Blog posts are displayed in a dedicated section on the search results page:
Search results for: "installation"
Results in blog posts:
• How to Install Your New Kitchen
• Installation Tips & Tricks
• Professional Installation Services
[Show more...]
Products:
[Product results...]
Installation
composer require iparmentier/magento2-elasticsuite-stock bin/magento module:enable Comwrap_ElasticsuiteBlog bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean bin/magento indexer:reindex elasticsuite_blog_fulltext
Requirements
- PHP 7.3+ or PHP 8.x
- Magento 2.3.x or 2.4.x
- Smile ElasticSuite 2.1 or higher
- Magefan Blog extension
Configuration
Admin Configuration
Navigate to Stores > Configuration > ElasticSuite > Blog Post settings
Blog Post Settings
- Max result: Maximum number of blog posts to display in the search results block (default: 5)
Autocomplete Settings
Navigate to Stores > Configuration > ElasticSuite > Autocomplete > Blog Post Autocomplete
- Max size: Maximum number of blog posts to display in autocomplete results (default: 5)
Making Blog Posts Searchable
- Go to Content > Blog > Posts
- Edit a blog post
- In the Search Engine section, enable "Is searchable"
- Save the post
The "Is searchable" flag determines whether a blog post will be indexed and appear in search results.
Usage
After installation and configuration:
- Enable Search for Blog Posts: Mark blog posts as searchable in the admin panel
- Reindex: Run the blog fulltext reindex to populate the search engine
- Test Search: Try searching for blog content from the frontend
The module automatically:
- Indexes searchable blog posts into ElasticSearch
- Shows relevant posts in autocomplete suggestions
- Displays blog results on the search page
- Filters out inactive or non-searchable posts
How It Works
Indexing Process
The module creates a dedicated ElasticSearch index for blog posts with the following fields:
blog_post index:
├── post_id (integer)
├── title (text, searchable, spellcheck)
├── content (text, searchable, spellcheck)
└── is_active (integer)
Content Processing
- HTML Filtering: Blog content is processed to remove HTML tags and formatting
- Text Normalization: Multiple spaces are collapsed for better search relevance
- Store Filtering: Only posts visible in the current store are indexed
Search Integration
The module integrates at multiple levels:
- Autocomplete: Adds a blog post data provider to search suggestions
- Search Results: Injects a blog results block above product results
- Query Processing: Uses ElasticSuite's query builder for relevant results
Technical Details
Architecture
Comwrap_ElasticsuiteBlog/
├── Model/
│ ├── Autocomplete/
│ │ └── Post/DataProvider.php # Autocomplete data provider
│ ├── Post/Indexer/
│ │ └── Fulltext.php # Main indexer implementation
│ └── ResourceModel/
│ └── Post/Fulltext/
│ └── Collection.php # ElasticSearch-aware collection
├── Block/
│ └── Post/
│ ├── Result.php # Search results block
│ └── Suggest.php # Suggestion block
└── etc/
├── elasticsuite_indices.xml # Index configuration
└── elasticsuite_search_request.xml # Search container config
Key Components
- Indexer:
elasticsuite_blog_fulltext
- Processes and indexes blog posts - Search Container:
blog_search_container
- Defines search request structure - Collection: Custom collection that queries ElasticSearch instead of MySQL
Database Schema
The module adds an is_searchable
field to the magefan_blog_post
table:
ALTER TABLE `magefan_blog_post` ADD COLUMN `is_searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'If post is searchable';
Troubleshooting
Blog posts not appearing in search
- Ensure posts are marked as "Is searchable" in admin
- Verify posts are active
- Run reindex:
bin/magento indexer:reindex elasticsuite_blog_fulltext
- Clear cache:
bin/magento cache:clean
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and feature requests, please use the GitHub issue tracker.
License
This module is licensed under the Open Software License ("OSL") v3.0. See the LICENSE.txt file for details.
Credits
- Developed by Comwrap
- Based on Smile ElasticSuite
- Integrates with Magefan Blog