Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Sphinx Search Beginner's Guide
  • Table Of Contents Toc
Sphinx Search Beginner's Guide

Sphinx Search Beginner's Guide

By : Abbas Ali
3.3 (4)
close
close
Sphinx Search Beginner's Guide

Sphinx Search Beginner's Guide

3.3 (4)
By: Abbas Ali

Overview of this book

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

Time for action - creating a basic search script


  1. 1. Add the searchd config section to /usr/local/sphinx/etc/sphinx-blog.conf:

    source blog {
    # source options
    }
    index posts {
    # index options
    }
    indexer {
    # indexer options
    }
    # searchd options (used by search daemon)
    searchd
    {
    listen = 9312
    log = /usr/local/sphinx/var/log/searchd.log
    query_log = /usr/local/sphinx/var/log/query.log
    max_children = 30
    pid_file = /usr/local/sphinx/var/log/searchd.pid
    }
    
  2. 2. Start the searchd daemon (as root user):

    $ sudo /usr/local/sphinx/bin/searchd -c /usr/local/sphinx/etc/sphinx-blog.conf
    
  3. 3. Copy the sphinxapi.php file (the class with PHP implementation of Sphinx API) from the sphinx source directory to your working directory:

    $ mkdir /path/to/your/webroot/sphinx
    $ cd /path/to/your/webroot/sphinx
    $ cp /path/to/sphinx-0.9.9/api/sphinxapi.php .
    
    
  4. 4. Create a simple_search.php script that uses the PHP client API class to search the Sphinx-blog index, and execute it in the browser:

    <?php
    require_once('sphinxapi.php...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Sphinx Search Beginner's Guide
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon