1. Add the following highlighted code in
search.php:
// Perform the search if we have a search term if (!empty($q)) { do_search($q, $author, $categories); } // Get all the categories and their ids // This will be used to build the categories filter drop down $query = "SELECT id, name FROM categories ORDER BY name"; foreach ($dbh->query($query) as $row) { $viewVars['cat_list'][$row['id']] = $row['name']; } // Assign the search parameters to view variable $viewVars['q'] = $q; $viewVars['author'] = $author; $viewVars['categories'] = $categories; // Render the page render('search');
2. Modify
search.thtml
and change or add the following highlighted code:<div class="input"> <label>Search for:</label> <input type="text" name="q" value="<?php echo $viewVars['q']; ?>" /> </div> <div class="input"> <label>Author:</label> <input type="text" name="author" value...
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