I use Magento 2.1
Thats one my attributes that should be visible in layered navigation:
$eavSetup->removeAttribute(Product::ENTITY, 'supported_software'); $eavSetup->addAttribute( Product::ENTITY, 'supported_software', [ 'type' => 'text', 'input' => 'multiselect', 'frontend_class' => 'required-entry', 'label' => 'Supported software', 'group' => 'Technical parameters', 'sort_order' => 190, 'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend', 'frontend' => '', 'source' => '', 'default' => 10, 'is_wysiwyg_enabled' => false, 'is_html_allowed_on_front' => false, 'used_for_sort_by' => false, 'global' => ScopedAttributeInterface::SCOPE_GLOBAL, 'visible' => true, 'required' => true, 'user_defined' => true, 'searchable' => false, 'visible_in_advanced_search' => false, 'search_weight' => '', 'filterable' => true, 'filterable_in_search' => true, 'comparable' => true, 'visible_on_front' => true, 'used_in_product_listing' => true, 'unique' => false, 'apply_to' => 'downloadable,bundle', 'is_used_for_promo_rules' => true, 'is_used_in_grid' => false, 'is_visible_in_grid' => false, 'is_filterable_in_grid' => false, 'is_required_in_admin_store' => '', 'system' => 0, ] );
After createing this attribute (and others) I add 40 products programatically. Most of them should have some values of this attribute. Possible option differs for admin (digits) and default store view (text). Of course I have well configured category tree (all of them are anchor). In fact if I look into product details on frontened all of them have some values.
When I go to frontend and hit any category layered navigation shows up, but for
supported_software results are very strange - for example some options are excluded from nav or doesn’t show proper amonut of products with this option. Many products have values in product details in product view page, but this values are not counted in filters. Sometimes when I edit any product in adminhtml results changes in filters, sometimes not, sometimes in very strange way - for example: if I have 10 product with values
x and 10 with values
y and I add product with value
z in layered navigation after reindex/cache flush only appears results for only one product with value z. Where should I look for. Is my setup of attribute correct?