/** * Init index model * @return \Mirasvit\Search\Model\Index */ protected function initModel() { $model = $this->indexFactory->create(); if ($this->getRequest()->getParam('id')) { $model->load($this->getRequest()->getParam('id')); } $this->registry->register('current_model', $model); return $model; }
/** * {@inheritdoc} * * @param ModuleDataSetupInterface $setup * @param ModuleContextInterface $context */ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $this->indexFactory->create()->load('catalogsearch_fulltext')->setCode('catalogsearch_fulltext')->setTitle('Products')->setIsActive(true)->setPosition(1)->save(); $this->indexFactory->create()->load('magento_catalog_category')->setCode('magento_catalog_category')->setTitle('Categories')->setIsActive(false)->setPosition(2)->setAttributes(['name' => 10, 'description' => 5, 'meta_title' => 9, 'meta_keywords' => 1, 'meta_description' => 1])->save(); $this->indexFactory->create()->load('magento_cms_page')->setCode('magento_cms_page')->setTitle('Information')->setIsActive(false)->setPosition(3)->setAttributes(['title' => 10, 'content' => 5, 'content_heading' => 9, 'meta_keywords' => 1, 'meta_description' => 1])->save(); }