开发者

CakePHP with Lucene

开发者 https://www.devze.com 2023-01-23 18:02 出处:网络
I am trying to implement Lucene with cakephp and following this guide http://jamienay.com/2010/01/zend_search_lucene-datasource-for-cakephp/

I am trying to implement Lucene with cakephp and following this guide http://jamienay.com/2010/01/zend_search_lucene-datasource-for-cakephp/

Am getting this error

ConnectionManager::loadDataSource - Unable to import DataSource class .ZendSearchLuceneSource

i have placed the Vendor files in app/vendors/Zend/

Added this in the 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;
}

added this to the Database Config

var $zendSearchLucene = array(
    'datasource' =>开发者_StackOverflow中文版; 'ZendSearchLucene',
    'indexFile' => 'lucene', // stored in the cache dir.
    'driver' => '',
    'source' => 'search_indices'
);

Add created a model called search.php

<?php
class Search extends AppModel {
    var $useDbConfig = 'zendSearchLucene';

}
?>

Right now i have created a controller called search too like this

<?php
class SearchController extends AppController {

    var $name = 'Search';

    function index(){

    }


}
?>

when i visit site/search am getting that error.


Not sure if this is still relevant to you, but I have just begun using the same datasource and came across the same issues. I updated the datasource for Cake 1.3 and it should work now.

Have a look at my fork of the project at Github:
https://github.com/deceze/zend_search_lucene_source

If you find any problems with it, please open tickets for them. I'll see if I can get around to fixing them. The datasource is a good basis, but may need some updating and extension.

0

精彩评论

暂无评论...
验证码 换一张
取 消