diff --git a/lib/Doctrine/Search.php b/lib/Doctrine/Search.php index f545bafec..c63386120 100644 --- a/lib/Doctrine/Search.php +++ b/lib/Doctrine/Search.php @@ -61,6 +61,15 @@ class Doctrine_Search extends Doctrine_Plugin } } + + public function search($query) + { + $q = new Doctrine_Search_Query($this->_options['pluginTable']); + + $q->search($query); + + return $q->execute(); + } public function analyze($text) { @@ -93,7 +102,6 @@ class Doctrine_Search extends Doctrine_Plugin $index->save(); } else { - print 'joo'; foreach ($fields as $field) { $value = $data[$field]; diff --git a/lib/Doctrine/Search/Analyzer/Standard.php b/lib/Doctrine/Search/Analyzer/Standard.php index 16dcf83b6..fb71124e8 100644 --- a/lib/Doctrine/Search/Analyzer/Standard.php +++ b/lib/Doctrine/Search/Analyzer/Standard.php @@ -59,6 +59,7 @@ class Doctrine_Search_Analyzer_Standard implements Doctrine_Search_Analyzer_Inte 'any', 'are', 'area', + 'arent', 'around', 'as', 'at', @@ -263,12 +264,15 @@ class Doctrine_Search_Analyzer_Standard implements Doctrine_Search_Analyzer_Inte 'will', 'with', 'would', + 'yet', 'you', 'your', + 'yours' ); public function analyze($text) { + $text = preg_replace('/[\'`´"]/', '', $text); $text = preg_replace('/[^A-Za-z0-9]/', ' ', $text); $text = str_replace(' ', ' ', $text); diff --git a/lib/Doctrine/Search/File.php b/lib/Doctrine/Search/File.php index ba0d85dfd..a6858fb08 100644 --- a/lib/Doctrine/Search/File.php +++ b/lib/Doctrine/Search/File.php @@ -57,6 +57,10 @@ class Doctrine_Search_File extends Doctrine_Search RecursiveIteratorIterator::LEAVES_ONLY); foreach ($it as $file) { + if (strpos($file, DIRECTORY_SEPARATOR . '.svn') !== false) { + continue; + } + $this->updateIndex(array('url' => $file->getPathName(), 'content' => file_get_contents($file))); }