public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
if (version_compare($context->getVersion(), '1.2.0', '<')) {
$this->updateCategorySearchableAttributes();
}
if (version_compare($context->getVersion(), '1.2.1', '<')) {
$productImageAttributeId = $this->eavSetup->getAttributeId(\Magento\Catalog\Model\Product::ENTITY, 'image');
$setup->getConnection()->update($setup->getTable('catalog_eav_attribute'), ['is_searchable' => 1], $setup->getConnection()->quoteInto('attribute_id = ?', $productImageAttributeId));
}
$setup->endSetup();
}