1. Create a
properties
directory in your webroot,/path/to/webroot/properties:
$ mkdir /path/to/webroot/properties
2. Create the
/path/to/webroot/properties/views
directory:$ mkdir /path/to/webroot/properties/views
3. Copy the
sphinxapi.php
file from the Sphinx source directory to theproperties
directory:$ cp /path/to/sphinx-0.9.9/api/sphinxapi.php /path/to/webroot/properties/
4. Create the file
/path/to/webroot/properties/init.php
with the following code:<?php /** * File: /path/to/webroot/properties/init.php */ // Database connection credentials $dsn ='mysql:dbname=sphinx_properties;host=localhost'; $user = 'root'; $pass = ''; // Instantiate the PDO (PHP 5 specific) class try { $dbh = new PDO($dsn, $user, $pass); } catch (PDOException $e){ echo'Connection failed: '.$e->getMessage(); } // Array to hold variables to be used in views $viewVars = array(); /** * Method to fetch the contents of a view (thtml) file * and return the contents...
Sphinx Search Beginner's Guide
By :
Sphinx Search Beginner's Guide
By:
Overview of this book
Table of Contents (15 chapters)
Sphinx Search
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Setting Up Sphinx
Getting Started
Indexing
Searching
Feed Search
Property Search
Sphinx Configuration
Customer Reviews