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 index


  1. 1. Create the Sphinx configuration file at /usr/local/sphinx/etc/properties.conf with the following content:

    source properties-source
    {
    type = mysql
    sql_host = localhost
    sql_user = root
    sql_pass =
    sql_db = sphinx_properties
    sql_query_range = SELECT MIN(id), MAX(id) FROM properties
    sql_range_step = 1000
    sql_query = SELECT id, type, \
    transaction_type, description, \
    price, city_id, bedrooms, bathrooms, area, \
    address, zip_code, built_year, \
    (latitude * PI() / 180) AS latitude, \
    (longitude * PI() / 180) AS longitude, \
    UNIX_TIMESTAMP(date_added) AS date_added \
    FROM properties
    WHERE id >= $start AND id <= $end
    sql_attr_uint = type
    sql_attr_uint = transaction_type
    sql_attr_uint = price
    sql_attr_uint = city_id
    sql_attr_uint = bedrooms
    sql_attr_uint = bathrooms
    sql_attr_float = area
    sql_attr_uint = built_year
    sql_attr_float = latitude
    sql_attr_float = longitude
    sql_attr_timestamp = date_added
    sql_attr_multi = uint amenity_id from query; \
    SELECT...