Ganesh H S

thoughts on life, entrepreneurship, technology

In the previous article Zend Lucene Search – part4 – Search Results Highlighting i talked about highlighting the keywords in search results. In this article i will be writing about highlighting the keywords in search results and formating the output display format much similar to most search engines result page using the zend lucene search. [...]

Once the index is created, we are ready use zend lucene search to search the website. In the following example, php is the search keyword used to fetch the relevant search results in the already indexed data. <?php require_once ‘Zend/Search/Lucene.php’;$query = “php”; $index = Zend_Search_Lucene::open(“/var/www/lucene-data/blog-index”); $results = $index->find($query); echo “Index contains “.$index->count().” documents.\n\n”; if($index->count()) { [...]

In the previous post about setting project environment setting http://ganeshhs.com/php/php-configuring-project-environment-using-ini-file , zend config plays a vital role in initializing the environment variables and by default, configuration data made available through Zend_Config are read-only. Lets write the ini configuration file application/config.ini [staging] db.adapter = PDO_MYSQL db.config.host = localhost db.config.username = mysql_user db.config.password = mysql_password db.config.dbname = [...]

Zend loader is much similar to require_once, best usage is if we have to load a file based on the variable value. <?php require_once “Zend/Loader.php”; Zend_Loader::loadClass(‘Zend_Session’); Zend_Session::start(); ?> The above example, illustrates loading the zend session class and starting the session. Here i am not going to discuss complete usage of zend loader, i will [...]

For creating the index from the existing data, we need to create the index. Isn’t it a better idea to index each data when its created, to index the real time data we need to open the index which was created earlier, rest of the other things remains same as discussed in the Zend lucene [...]

In this zend framework tutorial, we will learn how to create the file/directory layout when developing any project using zend framework. application – business logic files, no access for website users library – library files / reusable components, no access for website users public – access to outside users Considering the above points, here is [...]