What is the equivalent in magento2 of

$query = Mage::getModel('catalogsearch/layer');

$filterableAttributes = $query->getFilterableAttributes();

1 Answer 1


You can use below code to achieve it.

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();

$filterableAttributes = $objectManager->get(\Magento\Catalog\Model\Layer\Category\FilterableAttributeList::class);

Note: I will not recommend to use $objectManager

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.