cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.1 Notice: Undefined index: stock_status_bucket

Magento 2.3.1 Notice: Undefined index: stock_status_bucket

Hello.

I'm currently having Elastic Search 6.0+ enabled on my M2.3.1 site.
However when I search for a product, it show an error

1 exception(s):
Exception #0 (Exception): Notice: Undefined index: stock_status_bucket in /var/www/m23/vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder/Term.php on line 26

Exception #0 (Exception): Notice: Undefined index: stock_status_bucket in /var/www/m23/vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder/Term.php on line 26
<pre>#1 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term->build() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#2 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#3 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Amasty/Shopby/Plugin/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php:73]
#4 Amasty\Shopby\Plugin\Elasticsearch\SearchAdapter\Aggregation\Builder\Term->aroundBuild() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#5 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term\Interceptor->___callPlugins() called at [generated/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term/Interceptor.php:25]
#7 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Term\Interceptor->build() called at [vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder.php:90]
#8 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder->build() called at [vendor/magento/module-elasticsearch/Elasticsearch5/SearchAdapter/Adapter.php:127]
#9 Magento\Elasticsearch\Elasticsearch5\SearchAdapter\Adapter->query() called at [vendor/magento/module-search/Model/SearchEngine.php:42]
#10 Magento\Search\Model\SearchEngine->search() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#11 Magento\Search\Model\SearchEngine\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#12 Magento\Search\Model\SearchEngine\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/MageWorx/LocationPages/Plugin/UseMysqlForLocationPagePlugin.php:58]
#13 MageWorx\LocationPages\Plugin\UseMysqlForLocationPagePlugin->aroundSearch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#14 Magento\Search\Model\SearchEngine\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#15 Magento\Search\Model\SearchEngine\Interceptor->___callPlugins() called at [generated/code/Magento/Search/Model/SearchEngine/Interceptor.php:26]
#16 Magento\Search\Model\SearchEngine\Interceptor->search() called at [app/code/Amasty/Shopby/Model/ResourceModel/Fulltext/Collection.php:385]
#17 Amasty\Shopby\Model\ResourceModel\Fulltext\Collection->_renderFiltersBefore() called at [vendor/magento/framework/Data/Collection/AbstractDb.php:342]
#18 Magento\Framework\Data\Collection\AbstractDb->_renderFilters() called at [app/code/Amasty/Shopby/Model/ResourceModel/Fulltext/Collection.php:308]
#19 Amasty\Shopby\Model\ResourceModel\Fulltext\Collection->_renderFilters() called at [vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:1145]
#20 Magento\Catalog\Model\ResourceModel\Product\Collection->_getSelectCountSql() called at [vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:1133]
#21 Magento\Catalog\Model\ResourceModel\Product\Collection->getSelectCountSql() called at [vendor/magento/framework/Data/Collection/AbstractDb.php:220]
#22 Magento\Framework\Data\Collection\AbstractDb->getSize() called at [vendor/magento/framework/Data/Collection.php:258]
#23 Magento\Framework\Data\Collection->getLastPageNumber() called at [vendor/magento/module-theme/Block/Html/Pager.php:339]
#24 Magento\Theme\Block\Html\Pager->getLastPageNum() called at [app/code/Amasty/ShopbySeo/Observer/LayoutGenerateBlocksAfterObserver.php:64]
#25 Amasty\ShopbySeo\Observer\LayoutGenerateBlocksAfterObserver->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:72]
#26 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:60]
#27 Magento\Framework\Event\Invoker\InvokerDefault->dispatch() called at [vendor/magento/framework/Event/Manager.php:66]
#28 Magento\Framework\Event\Manager->dispatch() called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]
#29 Magento\Framework\Event\Manager\Proxy->dispatch() called at [vendor/magento/framework/View/Layout/Builder.php:134]
#30 Magento\Framework\View\Layout\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Page/Builder.php:55]
#31 Magento\Framework\View\Page\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Layout/Builder.php:65]
#32 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Page/Config.php:212]
#33 Magento\Framework\View\Page\Config->build() called at [vendor/magento/framework/View/Page/Config.php:225]
#34 Magento\Framework\View\Page\Config->publicBuild() called at [generated/code/Magento/Framework/View/Page/Config/Interceptor.php:37]
#35 Magento\Framework\View\Page\Config\Interceptor->publicBuild() called at [vendor/magento/framework/App/View.php:170]
#36 Magento\Framework\App\View->loadLayoutUpdates() called at [vendor/magento/framework/App/View.php:114]
#37 Magento\Framework\App\View->loadLayout() called at [vendor/magento/module-catalog-search/Controller/Result/Index.php:166]
#38 Magento\CatalogSearch\Controller\Result\Index->getNotCacheableResult() called at [vendor/magento/module-catalog-search/Controller/Result/Index.php:110]
#39 Magento\CatalogSearch\Controller\Result\Index->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#40 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#41 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Bss/ForceLogin/Plugin/CatalogSearch/Result/Index.php:104]
#42 Bss\ForceLogin\Plugin\CatalogSearch\Result\Index->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#43 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Amasty/SeoToolKit/Plugin/CatalogSearch/Controller/Result/Index.php:64]
#44 Amasty\SeoToolKit\Plugin\CatalogSearch\Controller\Result\Index->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#45 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#46 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php:26]
#47 Magento\CatalogSearch\Controller\Result\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#48 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#49 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#50 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Bss/ForceLogin/Plugin/OtherPage.php:86]
#51 Bss\ForceLogin\Plugin\OtherPage->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#52 Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#53 Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins() called at [generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php:39]
#54 Magento\CatalogSearch\Controller\Result\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:159]
#55 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:99]
#56 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#57 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#58 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94]
#59 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#60 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73]
#61 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#62 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#63 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#64 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:136]
#65 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]
#66 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]

I'm stuck here.
Can you please help me with this?

2 REPLIES 2

Re: Magento 2.3.1 Notice: Undefined index: stock_status_bucket

Hello @luan123abc 

 

Try to set "No" in stock status attribute(s) :

  • Use in Search
  • Use in Layered Navigation

https://drops.meetanshi.com/qSJYZf

 

Hope it helps.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento 2.3.1 Notice: Undefined index: stock_status_bucket

Hello @luan123abc 

 

Have you did  full reindex?


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer