This module extends Smile ElasticSuite to integrate Magefan Blog posts into the search engine, providing a unified search experience across products and blog content.
- 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
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
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...]
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- PHP 7.3+ or PHP 8.x
- Magento 2.3.x or 2.4.x
- Smile ElasticSuite 2.1 or higher
- Magefan Blog extension
Navigate to Stores > Configuration > ElasticSuite > Blog Post settings
- Max result: Maximum number of blog posts to display in the search results block (default: 5)
Navigate to Stores > Configuration > ElasticSuite > Autocomplete > Blog Post Autocomplete
- Max size: Maximum number of blog posts to display in autocomplete results (default: 5)
- 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.
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
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)
- 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
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
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
- 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
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';- 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
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and feature requests, please use the GitHub issue tracker.
This module is licensed under the Open Software License ("OSL") v3.0. See the LICENSE.txt file for details.
- Developed by Comwrap
- Based on Smile ElasticSuite
- Integrates with Magefan Blog