public function __construct(sfLucene $search) { sfLuceneToolkit::loadZend(); $this->query = new Zend_Search_Lucene_Search_Query_Boolean(); $this->search = $search; }
<?php /* * This file is part of the sfLucenePlugin package * (c) 2007 - 2008 Carl Vondrick <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ sfLuceneToolkit::loadZend(); /** * symfony adapter for Zend_Search_Lucene_Storage_File_Filesystem * @package sfLucenePlugin * @subpackage Addon * @version SVN: $Id: sfLuceneFileStorage.class.php 7108 2008-01-20 07:44:42Z Carl.Vondrick $ */ class sfLuceneFileStorage extends Zend_Search_Lucene_Storage_File_Filesystem { public function __construct($filename, $mode = 'r+b') { parent::__construct($filename, $mode); sfLuceneStorageFilesystem::chmod($filename, 0777); } }
/** * Zend Search Lucene makes it awfully hard to have multiple Lucene indexes * open at the same time. This method combats that by configuring all the * static variables for this instance. */ public function configure() { sfLuceneToolkit::loadZend(); $this->getEventDispatcher()->notify(new sfEvent($this, 'lucene.configure.pre')); Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding($this->getParameter('encoding')); switch (strtolower($this->getParameter('analyzer'))) { default: throw new sfLuceneException('Unknown analyzer: ' . $this->getParameter('analzyer')); case 'text': $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Text(); break; case 'textnum': $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum(); break; case 'utf8': case 'utf-8': $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8(); break; case 'utf8num': case 'utf-8num': $analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num(); break; } if (!$this->getParameter('case_sensitive', false)) { $analyzer->addFilter(new sfLuceneLowerCaseFilter($this->getParameter('mb_string', false))); } if (count($this->getParameter('stop_words'))) { $analyzer->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_StopWords($this->getParameter('stop_words'))); } if ($this->getParameter('short_words') > 0) { $analyzer->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_ShortWords($this->getParameter('short_words'))); } Zend_Search_Lucene_Analysis_Analyzer::setDefault($analyzer); $this->getEventDispatcher()->notify(new sfEvent($this, 'lucene.configure.post')); }