Sphinx Search Beginner's Guide


Sphinx Search Beginner's Guide
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
$20.39
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
$39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Create applications with full-text search functionality
  • Build indexes from varied data sources
  • Use the Sphinx client API implementation in your application to fire full text-search queries
  • Filter, sort, and group results based on different attributes
  • Search with different matching and ranking modes
  • Each chapter is explained using plenty of real-world examples

Book Details

Language : English
Paperback : 244 pages [ 235mm x 191mm ]
Release Date : March 2011
ISBN : 184951254X
ISBN 13 : 9781849512541
Author(s) : Abbas Ali
Topics and Technologies : All Books, Big Data and Business Intelligence, Beginner's Guides, Open Source

Table of Contents

Preface
Chapter 1: Setting Up Sphinx
Chapter 2: Getting Started
Chapter 3: Indexing
Chapter 4: Searching
Chapter 5: Feed Search
Chapter 6: Property Search
Chapter 7: Sphinx Configuration
Chapter 8: What Next?
Index
  • Chapter 1: Setting Up Sphinx
    • What you need to know
    • Different ways of performing a search
      • Searching on a live database
      • Searching an index
    • Sphinx—a full-text search engine
      • Features
      • A brief history
      • License
    • Installation
      • System requirements
      • Sphinx on a Unix-based system
    • Time for action – installation on Linux
      • Options to the configure command
      • Known issues during installation
      • Sphinx on Windows
    • Time for action – installation on Windows
      • Sphinx on Mac OS X
    • Time for action – installation on a Mac
      • Other supported systems
    • Summary
    • Chapter 2: Getting Started
      • Checking the installation
      • Full-text search
        • What is full-text search?
        • Traditional search
      • Time for action – normal search in MySQL
        • MySQL full-text search
        • Advantages of full-text search
        • When to use a full-text search?
      • Overview of Sphinx
        • Primary programs
      • Time for action – Sphinx in action
        • Data to be indexed
        • Creating the Sphinx configuration file
        • Searching the index
      • Why use Sphinx for full-text searching?
      • Summary
      • Chapter 3: Indexing
        • What are indexes?
          • Indexes in Sphinx
        • Index attributes
          • Types of attributes
            • Multi-value attributes (MVA)
        • Data sources
          • How to define the data source?
          • SQL data sources
            • Creating Index using SQL data source (Blog)
        • Time for action – creating database tables for a blog
        • Time for action – populate the database tables
        • Time for action – creating the Sphinx configuration file
        • Time for action – adding attributes to the index
        • Time for action – Adding an MVA to the index
          • xmlpipe data source
          • xmlpipe2 data source
            • Indexing with schema defined in XML stream
        • Time for action – creating index (without attributes)
        • Time for action – add attributes to schema
          • Indexing with schema defined in configuration file
      • Time for action – create index with schema defined in configuration file
      • Summary
        • Chapter 4: Searching
          • Client API implementations for Sphinx
          • Search using client API
          • Time for action – creating a basic search script
            • Matching modes
          • Time for action – searching with different matching modes
            • Boolean query syntax
          • Time for action – searching using Boolean query syntax
            • Extended query syntax
          • Time for action – searching with extended query syntax
          • Filtering full-text search results
          • Time for action – filtering the result set
          • Weighting search results
          • Time for action – weighting search results
          • Sorting modes
          • Grouping search results
          • Summary
          • Chapter 5: Feed Search
            • The application
              • Tools and software used while creating this application
              • Database structure
            • Time for action – creating the MySQL database and tables
              • Basic setup
            • Time for action – setting up the feeds application
              • Add feed
            • Time for action – creating a form to add feeds
              • Saving the feed data
            • Time for action – adding code to save feed
              • Indexing the feeds
            • Time for action – create the index
              • Check for duplicate items
            • Time for action – adding code to avoid duplicate items
              • Index merging
            • Time for action – adding the delta index
              • Search form
            • Time for action – creating the search form
              • Perform the search query
            • Time for action – adding code to perform a search query
              • Applying filters
            • Time for action – adding code to filter the results
            • Time for action – showing search form prefilled with last submitted data
              • Re-indexing
            • Summary
            • Chapter 6: Property Search
              • The application
                • Tools and software used while creating this application
                • Database structure
              • Time for action – creating the MySQL database and structure
                • Initial data
              • Time for action – populating the database
                • Basic setup
              • Time for action – setting up the application
                • Adding a property
              • Time for action – creating the form to add property
                • Indexing the properties
              • Time for action – creating the index
                • Simple search form
              • Time for action – creating the simple search form
                • Full-text search
              • Time for action – adding code to perform full-text search
                • Advanced search
              • Time for action – creating the Advanced search form
                • Ranged filters
              • Time for action – adding ranged filters
                • Geo distance search
              • Time for action – creating the search form
                • Add geo anchor
              • Time for action – adding code to perform geo distance search
              • Summary
              • Chapter 7: Sphinx Configuration
                • Sphinx configuration file
                  • Rules for creating the configuration file
                • Data source configuration
                  • SQL related options
                    • Connection options
                    • Options to fetch data (SQL data source)
                  • Configuration file using advanced options
                • Time for action – creating a configuration with advanced source options
                  • MS SQL specific options
                • Index configuration
                  • Distributed searching
                    • Set up an index on multiple servers
                • Time for action – creating indexes for distributed searching
                  • Set up the distributed index on the primary server
              • Time for action – adding distributed index configuration
                • Distributed searching on single server
              • charset configuration
              • Data related options
              • Word processing options
                • Morphology
              • Time for action – using morphology for stemming
                • Wordforms
              • Search daemon configuration
              • Indexer configuration
              • Summary
                • Chapter 8: What Next?
                  • SphinxQL
                    • SphinxQL in action
                  • Time for action – querying Sphinx using MySQL CLI
                    • SELECT
                      • Column list clause
                      • SHOW WARNINGS
                      • SHOW STATUS
                      • SHOW META
                  • Use case scenarios
                  • Popular websites using Sphinx
                  • Summary

                  Abbas Ali

                  Abbas Ali has over 6 years of experience in PHP Development and is a Zend Certified PHP 5 Engineer. A Mechanical Engineer by education, Abbas turned to software development just after finishing his engineering degree. He is a member of the core development team for the Coppermine Photo Gallery, an open source project which is one of the most popular photo gallery applications in the world. Fascinated with both machines and knowledge, Abbas is always learning new programming techniques. He got acquainted with Sphinx in 2009 and has been using it in most of his commercial projects ever since. He loves open source and believes in contributing back to the community. Abbas is married to Tasneem and has a cute little daughter, Munira. He lives at Nagpur (India) since his birth and is in no rush to move to any other city in the world. In his free time he loves to watch movies and television. He is also an amateur photographer and cricketer. Abbas is currently working as Chief Operating Officer and Technical Manager at SANIsoft Technologies Private Limited, Nagpur, India. The company specializes in development of large, high performance and scalable PHP applications.
                  Sorry, we don't have any reviews for this title yet.

                  Code Downloads

                  Download the code and support files for this book.


                  Submit Errata

                  Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                  Errata

                  - 5 submitted: last submission 24 Apr 2014

                  Errata type: Typo | Page number: 156 | Errata date: 14 May 11

                  Run the indexer command to create the index (as root): /usr/local/sphinx/bin/indexer -c /usr/local/sphinx/etc/properties.
                  Should be
                  Run the indexer command to create the index (as root): /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/properties

                   

                  Errata type: Typo | Page number: 188 | Errata date: 14 May 11

                  In the comment "# Turn of the query cache" change "of" to "off"

                   

                  Errata type: Code | Page number: 15

                  C:\sphinx\bin\searchd –install –config C:\sphinx\sphinx.conf – servicename SphinxSearch

                  should be:

                  C:\sphinx\bin\searchd --install --config C:\Sphinx\sphinx.conf.in --servicename SphinxSearch

                  Errata type: technical | Page number: 37

                  This sentence: "Attributes play some role in relevancy when SPH_SORT _EXPR sort mode is used" should have "SPH_SORT_EXPR" instead of "SPH_SORT _EXPR" (without a space blank).

                  Errata type: code | Errata page: 118 
                  On the seventh line from the end of page, this $stmt = $dbh->prepare(); should be $stmt = $dbh->prepare($query);

                  Errata type: technical | Errata page: 51
                  In the 3rd bullet point, the command line starting with $ /usr/local/sphinx/bin/ search should not have a space before search. It should be $ /usr/local/sphinx/bin/search.

                  Errata type: technical | Errata page: 81
                  On the tenth line of code, this print "Id: {$posmt['id']}<br />" should be print "Id: {$post['id']}<br />". (Without an 'm' in post.)

                  Sample chapters

                  You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                  Frequently bought together

                  Sphinx Search Beginner's Guide +    PostgreSQL Server Programming =
                  50% Off
                  the second eBook
                  Price for both: £23.65

                  Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                  What you will learn from this book

                  • Install Sphinx on your system
                  • Create indexes in Sphinx by using Sphinx's indexer utility
                  • Use the Sphinx API to issue search queries from your PHP applications
                  • Filter your search results using different attributes
                  • Create a functional application in PHP that will use the Sphinx search engine as the backend to serve search queries
                  • Use PHP to create an application that fetches different feeds and stores the feed item data in a Sphinx index
                  • Create an advanced search form that implements lots of filters, as well as a search form for geodistance searches
                  • Explore the different configuration options available in the Sphinx configuration file that tailor Sphinx according to your needs

                  In Detail

                  Sphinx is an open-source full-text search server, designed from the ground up with a focus on performance, relevance, and integration simplicity. With Sphinx, you can either batch index and search data stored in an SQL database, NoSQL storage, or just files quickly and easily — or index and search data on the fly, working with Sphinx pretty much as a database server.

                  Sphinx Search Beginner's Guide serves as a guide to everything you need to know about running a Sphinx Search Engine. In today's world, search is an integral part of any application and having a reliable search engine like Sphinx Search can be the difference between running a successful and unsuccessful business. What good is being on the Web if no one knows you are there? It is easy to build a proficient search engine with Sphinx Search Beginner's Guide to hand.

                  This practical guide provides insight into one of the most popular open source search engines, Sphinx. You will learn how to set up Sphinx on your own server, with the basics of how a search engine works explained in brief. You will learn how to create an index using Sphinx and then perform a search on that index using the client API, as well as learning how to configure Sphinx to get the most out of it. You will also be shown how Sphinx gives quality search results by relevance ranking. The book will help a beginner in all possible ways to create both simple and complex search forms in their applications. It's easy to use Sphinx Search engine, when you have the Sphinx Search Beginner's Guide to hand.

                  Approach

                  This book is a step-by-step guide for an absolute beginner. It covers everything, from installing to configuring, to get you started quickly. It has numerous code examples that the reader can try on their own and learn while doing so. It has two full-fledged applications as examples that readers can follow. This book is specifically focused on the Search feature of web applications.

                  Who this book is for

                  This book is for developers who are new to Sphinx Search. All code examples use PHP but the logic is same for any other web scripting languages as well.

                  Code Download and Errata
                  Packt Anytime, Anywhere
                  Register Books
                  Print Upgrades
                  eBook Downloads
                  Video Support
                  Contact Us
                  Awards Voting Nominations Previous Winners
                  Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                  Resources
                  Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software