类“Zend_Search_Lucene”未找到
作为 PHP 调用方面 Zend 框架的大初学者,我可以将其包含在 Netbeans IDE 中。现在我正在尝试使用它来使用 Zend_Lucene 实现 Lucene 索引器和搜索器,我遵循了官方网站的入门,不幸的是他们只用了几句话就解释了整个事情。不管怎样,我复制粘贴了这个 $index = Zend_Search_Lucene::create($indexPath);
,但是我在这一行收到一条消息: Fatal error: Class 'Zend_Search_Lucene' not found in C:\wamp \www\witswork\luceneTry.php 意味着该功能仍然未知,也许需要将一些文件复制到我的项目文件夹中,但实际上我现在已经没有想法了。 接受我的问候, 丹尼90。
A big beginner of Zend-framework on PHP calls, I could include it on Netbeans IDE. Now I'm trying to use it to achieve a Lucene indexer and searcher using Zend_Lucene, I followed the getting started of the official site, unfortunately they explain the whole thing with just few words. Anyway, I copied pasted this $index = Zend_Search_Lucene::create($indexPath);
, but I got a message onto this line saying: Fatal error: Class 'Zend_Search_Lucene' not found in C:\wamp\www\witswork\luceneTry.php
means that the function still unknown, maybe, some files need to be copied on my project folder but really I'm running out of ideas right now.
Accept my regards,
dany90.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先加载包含
Zend_Search_Lucene
类的 php 文件。一种选择是加载 your/path/to/library/Zend/Search/Lucene.php:该类加载其所有依赖项,因此您无需担心这一点。
另一种选择是使用 Zend 的自动加载器,
Zend_Loader_Autoloader
。这个类是一个单例,当你第一次检索它时,它会向spl_autoload()
注册自己:自动加载器加载后,你就可以使用
Zend_Search_Lucene
而无需>require_once()
调用。在 Zend Framework 的手册中,您可以可以找到有关自动加载器的更多信息。You need to load the php file which contains the
Zend_Search_Lucene
class first. One option is to load your/path/to/library/Zend/Search/Lucene.php:This class loads all its dependencies, so you don't need to worry about that.
Another option is to use the autoloader of Zend,
Zend_Loader_Autoloader
. This class is a singleton and registers itself withspl_autoload()
when you retrieve it for the first time:After the autoloader is loaded, you just can use
Zend_Search_Lucene
without therequire_once()
call. In the manual of Zend Framework you can find more information about the autoloader.