'Pdo_Pgsql', 'database' => 'newdatabase', 'username' => 'Pavel', 'password' => '115663225' )); $sql = new Sql($adapter); print('
'); if (isset($_POST['textarea'])){ $findString = $_POST['textarea']; /*$time1 = microtime(true); $selectWithFind = $sql->select(); $selectWithFind -> columns(array('movie_id', 'title')); $selectWithFind -> where ('title LIKE ?'); $selectWithFind -> where ('description LIKE ?', \Zend\Db\Sql\Predicate\PredicateSet::COMBINED_BY_OR); $selectWithFind -> from('MovieTable'); $selectWithFind -> limit(10); $statement = $sql->prepareStatementForSqlObject($selectWithFind); $result = $statement -> execute(array('%'.$findString.'%', '%'.$findString.'%')); print (microtime(true)-$time1); print('
'); foreach($result as $row){ print_r($row); print('
'); } print('
');*/ $stringsNC = explode(',', $findString); for ($q = 0; $q select(); $selectWithLexems -> columns(array('movie_id', 'title')); $selectWithLexems -> where('to_tsvector(\'russian\', description) @@ to_tsquery(\'russian\', ?)'); $selectWithLexems -> where('to_tsvector(\'russian\', title) @@ to_tsquery(\'russian\', ?)', \Zend\Db\Sql\Predicate\PredicateSet::COMBINED_BY_OR); $selectWithLexems -> from('MovieTable'); $selectWithLexems -> limit(10); $statement1 = $sql->prepareStatementForSqlObject($selectWithLexems); $result = $statement1 -> execute(array($resultString, $resultString)); print (microtime(true)-$time1); print ('
'); foreach($result as $row){ print_r($row); print('
'); } } ?>