private function addExpansionFields($fieldset, $model)
    {
        $form = $fieldset->getForm();

        /* @var $bagRenderer \Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions */
        $bagRenderer = $this->getLayout()->createBlock(
            'Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions'
        )->setForm($fieldset->getForm());

        $fieldset = $form->addFieldset('bag_of_words_fieldset', ['legend' => __('Bag of words')]);
        $fieldset->addField('bag_of_words', 'note', []);

        $form->getElement('bag_of_words_fieldset')
            ->setName('terms_relations')
            ->setValue($model->getTermsData())
            ->setRenderer($bagRenderer);
        $form->getElement('bag_of_words_fieldset')->getRenderer()->setValues($model->getTermsData());

        return $this;
    }
private function addExpansionFields($fieldset, $model)
    {
        $form = $fieldset->getForm();

        /* @var $bagRenderer \Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions */
        $bagRenderer = $this->getLayout()->createBlock(
            'Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions'
        )->setForm($fieldset->getForm());

        $fieldset = $form->addFieldset('bag_of_words_fieldset', ['legend' => __('Bag of words')]);
        $fieldset->addField('bag_of_words', 'note', []);

        $form->getElement('bag_of_words_fieldset')
            ->setName('terms_relations')
            ->setValue($model->getTermsData())
            ->setRenderer($bagRenderer);
        $form->getElement('bag_of_words_fieldset')->getRenderer()->setValues($model->getTermsData());

        return $this;
    }
private function addExpansionFields ( $ fieldset , $ model ) { $ form = $ fieldset -> getForm ( ) ; /* @var $bagRenderer \Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions */ $ bagRenderer = $ this -> getLayout ( ) -> createBlock ( 'Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Renderer\Expansions' ) -> setForm ( $ fieldset -> getForm ( ) ) ; $ fieldset = $ form -> addFieldset ( 'bag_of_words_fieldset' , [ 'legend' => __ ( 'Bag of words' ) ] ) ; $ fieldset -> addField ( 'bag_of_words' , 'note' , [ ] ) ; $ form -> getElement ( 'bag_of_words_fieldset' ) -> setName ( 'terms_relations' ) -> setValue ( $ model -> getTermsData ( ) ) -> setRenderer ( $ bagRenderer ) ; $ form -> getElement ( 'bag_of_words_fieldset' ) -> getRenderer ( ) -> setValues ( $ model -> getTermsData ( ) ) ; return $ this ; }
Adding expansion-related fields

@param \Magento\Framework\Data\Form\Element\Fieldset     $fieldset The fieldset
@param \Smile\ElasticsuiteThesaurus\Model\Thesaurus|null $model    Current Thesaurus

@return \Smile\ElasticsuiteThesaurus\Block\Adminhtml\Thesaurus\Edit\Form
Adding expansion - related fields