1. Modify
display_results.php
(created earlier) and add the code as highlighted next:if (count($cats)) { print "<br />Categories: " . implode(', ', $cats); } print "<br />Weight: " . $result['weight']; print "<hr />";
2. Create a PHP script
search_weighting.php
in your webroot containing the following code:<?php // Include the api class require('sphinxapi.php'); // Include the file which contains the function to display results require_once('display_results.php'); $client = new SphinxClient(); $client->SetServer('localhost', 9312); $client->SetConnectTimeout(1); $client->SetArrayResult(true); $client->SetMatchMode(SPH_MATCH_ANY); display_results( $client->Query('php language framework'), 'MATCH ANY'); $client->SetMatchMode(SPH_MATCH_BOOLEAN); display_results( $client->Query('php | framework'), 'BOOLEAN'); $client->SetMatchMode(SPH_MATCH_EXTENDED2); display_results( $client->Query('@* php | @* framework...
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