public function saveSearchResults(QueryModel $query)
    {
        $adapter = $this->getConnection();
        $table = $this->getMainTable();

        $numResults     = $query->getNumResults();
        $isSpellchecked = (int) $query->getIsSpellchecked();

        $saveData = [
            'store_id'        => $query->getStoreId(),
            'query_text'      => $query->getQueryText(),
            'num_results'     => $numResults,
            'is_spellchecked' => $isSpellchecked,
        ];

        $updateData = ['num_results' => $numResults, 'is_spellchecked' => $isSpellchecked];

        $adapter->insertOnDuplicate($table, $saveData, $updateData);
    }
public function saveSearchResults(QueryModel $query)
    {
        $adapter = $this->getConnection();
        $table = $this->getMainTable();

        $numResults     = $query->getNumResults();
        $isSpellchecked = (int) $query->getIsSpellchecked();

        $saveData = [
            'store_id'        => $query->getStoreId(),
            'query_text'      => $query->getQueryText(),
            'num_results'     => $numResults,
            'is_spellchecked' => $isSpellchecked,
        ];

        $updateData = ['num_results' => $numResults, 'is_spellchecked' => $isSpellchecked];

        $adapter->insertOnDuplicate($table, $saveData, $updateData);
    }
public function saveSearchResults ( QueryModel $ query ) { $ adapter = $ this -> getConnection ( ) ; $ table = $ this -> getMainTable ( ) ; $ numResults = $ query -> getNumResults ( ) ; $ isSpellchecked = ( int ) $ query -> getIsSpellchecked ( ) ; $ saveData = [ 'store_id' => $ query -> getStoreId ( ) , 'query_text' => $ query -> getQueryText ( ) , 'num_results' => $ numResults , 'is_spellchecked' => $ isSpellchecked , ] ; $ updateData = [ 'num_results' => $ numResults , 'is_spellchecked' => $ isSpellchecked ] ; $ adapter -> insertOnDuplicate ( $ table , $ saveData , $ updateData ) ; }
Save query with number of results and is spellchecked.

@param QueryModel $query Search query object.

@return void
Save query with number of results and is spellchecked .