我試圖使用CakePHP實現Lucene和本指南 http://jamienay.com/2010/01/zend_search_lucene-datasource-for-cakephp/CakePHP的使用Lucene
正在此錯誤
的ConnectionManager :: loadDataSource以下 - 無法導入數據源類.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';
}
?>
眼下模型我創建了一個名爲控制器搜索過這樣
<?php
class SearchController extends AppController {
var $name = 'Search';
function index(){
}
}
?>
當我訪問網站/搜索獲取該錯誤。
已經做到了這一點,也複製zend_search_lucene.php模型/ datasources – 2010-11-07 18:48:02