PHPackages                             creativestyle/magesuite-elasticsuite-virtual-category-indexer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. creativestyle/magesuite-elasticsuite-virtual-category-indexer

ActiveMagento2-module

creativestyle/magesuite-elasticsuite-virtual-category-indexer
=============================================================

ElasticSuite Virtual Category Indexer

v1.3.1(10mo ago)815.2k↓42.9%2[1 issues](https://github.com/magesuite/elasticsuite-virtual-category-indexer/issues)OSL-3.0PHP

Since Aug 9Pushed 10mo ago3 watchersCompare

[ Source](https://github.com/magesuite/elasticsuite-virtual-category-indexer)[ Packagist](https://packagist.org/packages/creativestyle/magesuite-elasticsuite-virtual-category-indexer)[ Docs](https://creativestyle.de)[ RSS](/packages/creativestyle-magesuite-elasticsuite-virtual-category-indexer/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependenciesVersions (41)Used By (0)

ElasticSuite Virtual Category Indexer
=====================================

[](#elasticsuite-virtual-category-indexer)

[![](Docs/MageSuite__ElasticsuiteVirtualCategoryIndexer.png)](Docs/MageSuite__ElasticsuiteVirtualCategoryIndexer.png)

Configuration
-------------

[](#configuration)

To enable `virtual category indexer` or change a cron schedule go to: `Store > Configuration > MageSuite > Virtual Category Indexer > General`

CLI Commmand
------------

[](#cli-commmand)

CommandDescription`indexer:reindex elasticsuite_virtual_category_indexer`Reindex all virtual categories. It reindex whole `catalogsearch_category` index`magesuite:elasticsuite:virtual-category-products-relations:reindex [-s, --strategy  [STRATEGY]] [-c , --ids [CATEGORY IDS]]`Reindex virtual categories with strategy (full, list, category)`magesuite:elasticsuite:virtual-category-products-relations:delete`Cleanup/revert indexed virtual categories relationsCron
----

[](#cron)

Full reindexation is runing automaticaly by cron schedule.

Important module classes
------------------------

[](#important-module-classes)

ClassResponsibilityMageSuite\\ElasticsuiteVirtualCategoryIndexer\\Model\\Indexer\\VirtualCategoryIndexerInsert product ids into the table `catalog_category_product` and refresh catalog and elasticsuite indexesMageSuite\\ElasticsuiteVirtualCategoryIndexer\\Model\\ElasticsuiteVirtualCategory\\Model\\PreviewAllow to get raw data from from response from elasticsearch using `getRawData()` methodMageSuite\\ElasticsuiteVirtualCategoryIndexer\\Model\\Catalog\\ResourceModel\\CategoryProductExtension Class for `Magento\Catalog\Model\ResourceModel\CategoryProduct`. Allow to insert *product* ids for a virtual category into the table `catalog_category_product` and get theirs ids for other operationsMageSuite\\ElasticsuiteVirtualCategoryIndexer\\Model\\ResourceModel\\CategoryProductRelationsResource Model which provide the method to delete category ids from the table `catalog_category_product`.MageSuite\\ElasticsuiteVirtualCategoryIndexer\\Plugin\\Catalog\\Category\\ReindexOnChangePlugin which is call before runing the reindex method on category model and causes run `virtual category indexer`MageSuite\\ElasticsuiteVirtualCategoryIndexer\\Plugin\\ElasticsuiteVirtualCategory\\Model\\Rule\\GetCategorySearchQueryPlugin which change value of `is_virtual_category` attribute to `null` . It force sending standard category request to elasticsearch instead of depends of the attribute value.Extension attribute
-------------------

[](#extension-attribute)

Module provide the extension attribute `virtual_query` to modify request to elasticsaerch using the plugin. If it has `true` smile works standardly. `False` value remove virtual query request.

See: `\Smile\ElasticsuiteVirtualCategory\Model\Rule::getCategorySearchQuery`

```
public function getCategorySearchQuery($category, $excludedCategories = []): ?QueryInterface
{
    $query = null;

    if (!is_object($category)) {
        $category = $this->categoryFactory->create()->setStoreId($this->getStoreId())->load($category);
    }

    if (!in_array($category->getId(), $excludedCategories)) {
        $excludedCategories[] = $category->getId();

        if ((bool) $category->getIsVirtualCategory() && $category->getIsActive()) {
           $query = $this->getVirtualCategoryQuery($category, $excludedCategories, $category->getData('virtual_category_root'));
        } elseif ($category->getId() && $category->getIsActive()) {
            $query = $this->getStandardCategoryQuery($category, $excludedCategories);
        }
        if ($query && $category->hasChildren()) {
            $query = $this->addChildrenQueries($query, $category, $excludedCategories);
        }
    }

    return $query;
}
```

EAV attribute
-------------

[](#eav-attribute)

Module install a new category attribute `virtual_category_reindex_required`. If this attribute has `value=1` smile works standardly.

Troubleshooting and todo in the future
--------------------------------------

[](#troubleshooting-and-todo-in-the-future)

### When change root category of virtual category, previous products still are in the category

[](#when-change-root-category-of-virtual-category-previous-products-still-are-in-the-category)

To remove product from categories run full reindexation.

### After turn on module, virtual category does not display products anymore

[](#after-turn-on-module-virtual-category-does-not-display-products-anymore)

If you see products on the preview in admin area:

[![](Docs/products_list_preview.png)](Docs/products_list_preview.png)

it seems that ES is able to return the right product IDs in the indexer.

Make sure that the script provides the right category object here:

`vendor/creativestyle/magesuite-elasticsuite-virtual-category-indexer/Model/Indexer/VirtualCategoryIndexer.php:150`

[![](Docs/category_2.png)](Docs/category_2.png)

should be the same as here:

`vendor/creativestyle/magesuite-elasticsuite-virtual-category-indexer/Controller/Adminhtml/Category/Virtual/Preview.php:67`

[![](Docs/category_1.png)](Docs/category_1.png)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance51

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~66 days

Total

41

Last Release

319d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6814811?v=4)[creativestyle](/maintainers/creativestyle)[@creativestyle](https://github.com/creativestyle)

---

Top Contributors

[![ijozwiak](https://avatars.githubusercontent.com/u/26056813?v=4)](https://github.com/ijozwiak "ijozwiak (54 commits)")[![Leone](https://avatars.githubusercontent.com/u/619464?v=4)](https://github.com/Leone "Leone (12 commits)")[![evilprophet](https://avatars.githubusercontent.com/u/9113198?v=4)](https://github.com/evilprophet "evilprophet (10 commits)")[![adamkarnowka](https://avatars.githubusercontent.com/u/511845?v=4)](https://github.com/adamkarnowka "adamkarnowka (3 commits)")[![piotrmatras](https://avatars.githubusercontent.com/u/11822697?v=4)](https://github.com/piotrmatras "piotrmatras (2 commits)")

### Embed Badge

![Health badge](/badges/creativestyle-magesuite-elasticsuite-virtual-category-indexer/health.svg)

```
[![Health](https://phpackages.com/badges/creativestyle-magesuite-elasticsuite-virtual-category-indexer/health.svg)](https://phpackages.com/packages/creativestyle-magesuite-elasticsuite-virtual-category-indexer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
