Sphinx Search Beginner's Guide
Formats:
save 15%!
save 37%!
Free Shipping!
| Also available on: |
|
- 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 : EnglishPaperback : 244 pages [ 235mm x 191mm ]
Release Date : March 2011
ISBN : 184951254X
ISBN 13 : 9781849512541
Author(s) : Abbas Ali
Topics and Technologies : All Books, Beginner's Guides, Open Source
Table of Contents
PrefaceChapter 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
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
- 3 submitted: last submission 28 Feb 2013Errata 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
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- 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
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.
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.
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.

