private function addCategoryNameSearchAttribute()
{
// Installing the new attribute.
$this->eavSetup->addAttribute(Category::ENTITY, 'use_name_in_product_search', ['type' => 'int', 'label' => 'Use category name in product search', 'input' => 'select', 'source' => 'Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Boolean', 'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE, 'required' => true, 'default' => 1, 'visible' => true, 'note' => "If the category name is used for fulltext search on products.", 'sort_order' => 150, 'group' => 'General Information']);
// Set the attribute value to 1 for all existing categories.
$this->updateAttributeDefaultValue(Category::ENTITY, 'use_name_in_product_search', 1);
}