Fulltext search throws “The bucket doesn't exist”
-
15-04-2021 - |
Frage
Reopening this discussion, as none of the found solutions worked.
I have about 60 categories and subcategories, going down 4 levels deep. Number of products is irrelevant, this bug reproduces with 10 products, as well as with 4000.
What I've tried
- Setting the Root Category to not-anchored, and then to anchored back again
- Just having one root category
- Setting all categories to
is_anchor=false
, then back tois_anchor=true
in a bulk fashion straight in the database (UPDATE catalog_category_entity_int set value = 1 where attribute_id = 54;
) - Flushing caches and reindexing in the meantime
- Commenting out the exception, but then the search simply does not work (returns a bunch of non-related products)
Versions
- Magento 2.3.5-p1
- Theme "Infortis Ultimo Modif"
- PHP 7.3.24
- No ElasticSearch
References
- Magento 2 - Filter through non anchor categories throws “The bucket doesn't exist.” exception
- Bucket does not exist in Magento 2 error
- Exception when filtering by category in Layered Navigation (Bucket does not exist
- when i click on category filter on Category List page Category filter getting error “Bucket does not exist”
- How to Set Anchor to YES in all Categories in Magento 2
Stacktrace
Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist.
<pre>#1 Manadev\ProductCollection\Resources\Collections\FullTextProductCollection->getFacetedData('category') called at [generated/code/Manadev/ProductCollection/Resources/Collections/FullTextProductCollection/Interceptor.php:63]
#2 Manadev\ProductCollection\Resources\Collections\FullTextProductCollection\Interceptor->getFacetedData('category') called at [vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php:113]
#3 Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:202]
#4 Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:159]
#5 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems() called at [vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php:148]
#6 Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItemsCount() called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:33]
#7 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->canShowOptions(array(&Magento\CatalogSearch\Model\Layer\Filter\Category#00000000261d0415000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041d000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0419000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041a000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0466000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0410000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0413000000006d43a070#)) called at [vendor/magento/module-catalog/Model/Layer/Category/AvailabilityFlag.php:23]
#8 Magento\Catalog\Model\Layer\Category\AvailabilityFlag->isEnabled(&Magento\Catalog\Model\Layer\Search#00000000261d0597000000006d43a070#, array(&Magento\CatalogSearch\Model\Layer\Filter\Category#00000000261d0415000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041d000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0419000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d041a000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0466000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0410000000006d43a070#, &Magento\CatalogSearch\Model\Layer\Filter\Attribute#00000000261d0413000000006d43a070#)) called at [vendor/magento/module-layered-navigation/Block/Navigation.php:126]
#9 Magento\LayeredNavigation\Block\Navigation->canShowBlock() called at [app/design/frontend/Infortis/base/Magento_LayeredNavigation/templates/layer/view.phtml:18]
Lösung
TL;DR
Uninstall Manadev's Layered Navigation (Filters) with Multiple Select for Magento 2 extensions.
Long version
For debug purposes, I removed the thrown exception just to see what happens. After that, search by any string showed all products each time. So fulltext search wasn't working at all.
My final and successful thought was to check for buggy extensions, and encountered Manadev. Disabling it wasn't enough, it had to go forever. I'm not even in the mood to search for a working version of it.
Steps as described in the link above:
- Delete folder
app/code/Manadev
- Delete the file
bin/mana
- Drop tables from DB (make sure "Enable foreign key check" is disabled, if you're running the script from phpmyadmin)
SET @@foreign_key_checks = 0;
DROP TABLE IF EXISTS mana_config_history;
DROP TABLE IF EXISTS mana_extension;
DROP TABLE IF EXISTS mana_filter;
DROP TABLE IF EXISTS mana_filter_edit;
DROP TABLE IF EXISTS mana_url_key;
DROP TABLE IF EXISTS mana_url_key_conflict_resolution;
SET @@foreign_key_checks = 1;
DELETE FROM setup_module WHERE module LIKE 'Manadev_%';
- Execute
php bin/magento setup:upgrade
Your fulltext search will now work properly.