{"id":1087,"date":"2022-08-30T15:12:10","date_gmt":"2022-08-30T15:12:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/class-zend_search_lucene-not-found-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:12:10","modified_gmt":"2022-08-30T15:12:10","slug":"class-zend_search_lucene-not-found-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/class-zend_search_lucene-not-found-collection-of-common-programming-errors\/","title":{"rendered":"Class &#39;Zend_Search_Lucene&#39; not found-Collection of common programming errors"},"content":{"rendered":"<p>A big beginner of Zend-framework on PHP calls, I could include it on Netbeans IDE. Now I&#8217;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 <code>$index = Zend_Search_Lucene::create($indexPath);<\/code>, but I got a message onto this line saying: Fatal error: Class &#8216;Zend_Search_Lucene&#8217; 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&#8217;m running out of ideas right now. Accept my regards, dany90.<\/p>\n<ol>\n<li>\n<p>You need to load the php file which contains the <code>Zend_Search_Lucene<\/code> class first. One option is to load your\/path\/to\/library\/Zend\/Search\/Lucene.php:<\/p>\n<pre><code>require_once 'my\/path\/to\/library\/Zend\/Search\/Lucene.php';\n$index = new Zend_Search_Lucene::create($indexPath);\n<\/code><\/pre>\n<p>This class loads all its dependencies, so you don&#8217;t need to worry about that.<\/p>\n<p>Another option is to use the autoloader of Zend, <code>Zend_Loader_Autoloader<\/code>. This class is a singleton and registers itself with <code>spl_autoload()<\/code> when you retrieve it for the first time:<\/p>\n<pre><code>$autoloader = Zend_Loader_Autoloader::getInstance();\n$index      = new Zend_Search_Lucene::create($indexPath);\n<\/code><\/pre>\n<p>After the autoloader is loaded, you just can use <code>Zend_Search_Lucene<\/code> without the <code>require_once()<\/code> call. In the manual of Zend Framework you can find more information about the autoloader.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:22:24. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>A big beginner of Zend-framework on PHP calls, I could include it on Netbeans IDE. Now I&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-1087","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-zend-framework"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1087"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1087\/revisions"}],"predecessor-version":[{"id":8901,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1087\/revisions\/8901"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}