Skip to main content

Posts

Showing posts from 2015

Optimise Search Results - Elastic Search

Although Elasticsearch offers an efficient scoring algorithm, it may often be inadequate in e-commerce contexts. Most users tend to care only about the topmost number of results. which means that it’s very important to have a flexible scoring mechanism. If you can present the topmost results according to user preference, then your conversion rate is likely to increase significantly. In this article, we’ll look at the default scoring configuration in Elasticsearch, and we'll also walk through several customizations to the scoring. This knowledge can help you achieve a user-customizable list of results. By default, Elasticsearch makes use of the Lucene’s practical scoring formula, which represents the relevance score of each document with a positive floating-point number known as the _score . The higher the _score, the higher the relevance of the document. A query clause generates a _score for each document, and the calculation for that score depends on th

Setup CakePHP Using Xampp On Windows

Step 1: Download XAMPP  and  CakePHP .   Step 2: Install Xampp Once you have installed Xampp (version 1.7.3) on your Windows with the default option, all your files will be located in the C:\xampp folder. Step 3: Mod Rewrite Module Once Xampp is installed as the local server, you can then proceed to enable mod_rewrite. To do so, you will have to open the httpd.conf file that is located in C:\xampp\apache\conf and uncomment by removing # from the following line: # LoadModule rewrite_module modules/mod_rewrite.so Step 4: Place CakePHP Files in a New Folder Extract the CakePHP (version 1.3.8) zip file and copy all its contents to your local web server, which in this instance is C:\xampp\htdocs\cakephp . I have decided to name the CakePHP folder as cakephp, and in it, you will find many files and folders for the framework, including app, cake, docs, vendors, .htaccess, and index.php. Step 5: Set Up Virtual Host Open the httpd-vhosts.conf file from the C:\xampp\apa

Dynamic Sitemap Generation plugin in Cakephp

Here for the SEO implementation we need to generate the sitemap.xml in our application which is accessed by the webmaster tool. So here i am outlined the steps to generate the Xml file . 1. Lets think we have controller by name sitemap,Inside that create an action by name sitemap and paste the following code    public function sitemap(){     $this->layout='ajax';     $this->RequestHandler->respondAs('xml');     $listData = $this->Sitemap->find('all',/*Conditions if you have any*/);     $this->set(compact('listData')); } I through variable $listData to render all data( Keywords,Title,Url,etc ...) that will be shown in sitemap.xml.  This   depends   on the   dynamic link  what   we want to   show  in sitemap.xml.For request handler to work include the RequestHandler component public $components = array('RequestHandler'); Step 2. Create View based on action sitemap On structure MVC as default we need create sitemap.

PHP & Mysql interview question

What’s PHP The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications Who is the father of PHP and explain the changes in PHP versions?  Rasmus Lerdorf in 1994   How many ways you can retrieve the data in the result set of mysql using PHP? We can do it by 4 Ways          1. mysql_fetch_row ,                The mysql_fetch_row() function fetches one row from a result-set and returns it as an                enumerated array.         2. mysql_fetch_array ,                The mysql_fetch_array() function fetches a result row as an associative array, a numeric                 array, or both.         3. mysql_fetch_object                The mysql_fetch_object() function returns the current row of a result set, as an object.          4. mysql_fetch_assoc                 The mysql_fetch_assoc() function fetches a result row