private function getBaseSelect($storeId, $type)
    {
        $connection = $this->getConnection();
        $select     = $connection->select();

        $select->from(['thesaurus' => $this->getMainTable()], [])
            ->join(
                ['terms' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)],
                'thesaurus.thesaurus_id = terms.thesaurus_id',
                []
            )
            ->join(
                ['store' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)],
                'store.thesaurus_id = thesaurus.thesaurus_id',
                []
            )
            ->group(['thesaurus.thesaurus_id', 'terms.term_id'])
            ->where("thesaurus.type = ?", $type)
            ->where('thesaurus.is_active = 1')
            ->where('store.store_id IN (?)', [0, $storeId]);

        return $select;
    }
private function getBaseSelect($storeId, $type)
    {
        $connection = $this->getConnection();
        $select     = $connection->select();

        $select->from(['thesaurus' => $this->getMainTable()], [])
            ->join(
                ['terms' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)],
                'thesaurus.thesaurus_id = terms.thesaurus_id',
                []
            )
            ->join(
                ['store' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)],
                'store.thesaurus_id = thesaurus.thesaurus_id',
                []
            )
            ->group(['thesaurus.thesaurus_id', 'terms.term_id'])
            ->where("thesaurus.type = ?", $type)
            ->where('thesaurus.is_active = 1')
            ->where('store.store_id IN (?)', [0, $storeId]);

        return $select;
    }
private function getBaseSelect ( $ storeId , $ type ) { $ connection = $ this -> getConnection ( ) ; $ select = $ connection -> select ( ) ; $ select -> from ( [ 'thesaurus' => $ this -> getMainTable ( ) ] , [ ] ) -> join ( [ 'terms' => $ this -> getTable ( ThesaurusInterface :: EXPANSION_TABLE_NAME ) ] , 'thesaurus.thesaurus_id = terms.thesaurus_id' , [ ] ) -> join ( [ 'store' => $ this -> getTable ( ThesaurusInterface :: STORE_TABLE_NAME ) ] , 'store.thesaurus_id = thesaurus.thesaurus_id' , [ ] ) -> group ( [ 'thesaurus.thesaurus_id' , 'terms.term_id' ] ) -> where ( "thesaurus.type = ?" , $ type ) -> where ( 'thesaurus.is_active = 1' ) -> where ( 'store.store_id IN (?)' , [ 0 , $ storeId ] ) ; return $ select ; }
Base select for thesaurus terms select by store id.

@param int    $storeId Store id.
@param string $type    Type of thesaurus (synonym or expansion).

@return \Magento\Framework\DB\Select
Base select for thesaurus terms select by store id .