Book Image

Sphinx Search Beginner's Guide

By : Abbas Ali
Book Image

Sphinx Search Beginner's Guide

By: Abbas Ali

Overview of this book

Table of Contents (15 chapters)
Sphinx Search
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Time for action - creating the MySQL database and structure


  1. 1. Open phpMyAdmin and create a database sphinx_properties. You can use an existing database as well.

  2. 2. Import the following SQL to create the database tables:

    CREATE TABLE IF NOT EXISTS `amenities` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `amenities_properties` (
    `amenity_id` int(11) NOT NULL,
    `property_id` int(11) NOT NULL,
    PRIMARY KEY (`amenity_id`,`property_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `cities` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `properties` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `type` enum('1','2') NOT NULL DEFAULT '1',
    `transaction_type` enum('1','2','3') NOT NULL DEFAULT '1',
    `description` text NOT NULL,
    `price` int(11) NOT NULL,
    `city_id` int(11) NOT...