CakePHP与Lucene
我正在尝试用cakephp实现Lucene并遵循本指南
http://jamienay.com/2010/01/zend_search_lucene-datasource-for-cakephp/
我收到这个错误
ConnectionManager :: loadDataSource - 无法导入DataSource类.ZendSearchLuceneSource
我已将供应商文件放在app / vendors / Zend /中
在bootstrap.php中添加了这个
ini_set('include_path', ini_get('include_path') . ':' . CAKE_CORE_INCLUDE_PATH . DS . '/vendors');
/**
* AutoLoading Zend Vendor Files
*/
function __autoload($path) {
if(substr($path, 0, 5) == 'Zend_') {
include str_replace('_', '/', $path) . '.php';
}
return $path;
}
将其添加到数据库配置中
var $zendSearchLucene = array(
'datasource' => 'ZendSearchLucene',
'indexFile' => 'lucene', // stored in the cache dir.
'driver' => '',
'source' => 'search_indices'
);
添加创建了一个名为search.php的模型
<?php
class Search extends AppModel {
var $useDbConfig = 'zendSearchLucene';
}
?>
现在我已经创建了一个名为search的控制器
<?php
class SearchController extends AppController {
var $name = 'Search';
function index(){
}
}
?>
当我访问网站/搜索我得到的错误。
没有找到相关结果
已邀请:
1 个回复
稍惮