1. Create a script
/path/to/webroot/properties/search.php
with the following content:<?php /** * File: /path/to/webroot/properties/search.php */ include('init.php'); // Get the list of cities $query = "SELECT id, name FROM cities"; foreach ($dbh->query($query) as $row) { $viewVars['cities'][$row['id']] = $row['name']; } // Render the view render('search');
2. Create the view for the search page at
/path/to/webroot/properties/views/search.thtml:
<form action="advanced_search.php" method="post"> <fieldset> <legend>Advanced search</legend> <div class="input"> <label>City: </label> <select name="city_id"> <?php foreach ($viewVars['cities'] as $id => $name):?> <option value="<?php echo $id; ?>"> <?php echo $name; ?></option> <?php endforeach; ?> </select> </div> <div class="input"> <label>Type: </label> <input type...
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