O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Search with Sphinx

Book Description

Webmasters want fast and powerful search capabilities on their sites, and content management system administrators would like to reveal the wealth of their databases. The solution in both cases is the Sphinx search engine. This concise introduction to Sphinx shows you how to use this free software to index an enormous number of documents and provide fast results to both simple and complex searches.

Table of Contents

  1. Introduction to Search with Sphinx
  2. Preface
    1. Audience
    2. Organization of This Book
    3. Conventions Used in This Book
    4. Using Code Examples
    5. We’d Like to Hear from You
    6. Safari® Books Online
    7. Acknowledgments
  3. 1. The World of Text Search
    1. Terms and Concepts in Search
      1. Thinking in Documents Versus Databases
      2. Why Do We Need Full-Text Indexes?
      3. Query Languages
      4. Logical Versus Full-Text Conditions
        1. Logical conditions
        2. Full-text queries
        3. Differences between logical and full-text searches
      5. Natural Language Processing
      6. From Text to Words
      7. Linguistics Crash Course
      8. Relevance, As Seen from Outer Space
      9. Result Set Postprocessing
      10. Full-Text Indexes
    2. Search Workflows
      1. Kinds of Data
      2. Indexing Approaches
      3. Full-Text Indexes and Attributes
      4. Approaches to Searching
      5. Kinds of Results
  4. Getting Started with Sphinx
    1. Workflow Overview
    2. Getting Started ... in a Minute
    3. Basic Configuration
      1. Defining Data Sources
        1. Disk-based indexes
        2. RT indexes
        3. Distributed indexes
      2. Declaring Fields and Attributes in SQL Data
      3. Sphinx-Wide Settings
      4. Managing Configurations with Inheritance and Scripting
    4. Accessing searchd
      1. Configuring Interfaces
      2. Using SphinxAPI
      3. Using SphinxQL
    5. Building Sphinx from Source
      1. Quick Build
      2. Source Build Requirements
      3. Configuring Sources and Building Binaries
  5. 3. Basic Indexing
    1. Indexing SQL Data
      1. Main Fetch Query
      2. Pre-Queries, Post-Queries, and Post-Index Queries
      3. How the Various SQL Queries Work Together
      4. Ranged Queries for Larger Data Sets
    2. Indexing XML Data
      1. Index Schemas for XML Data
      2. XML Encodings
      3. xmlpipe2 Elements Reference
    3. Working with Character Sets
    4. Handling Stop Words and Short Words
  6. 4. Basic Searching
    1. Matching Modes
    2. Full-Text Query Syntax
      1. Known Operators
      2. Escaping Special Characters
      3. AND and OR Operators and a Notorious Precedence Trap
      4. NOT Operator
      5. Field Limit Operator
      6. Phrase Operator
      7. Keyword Proximity Operator
      8. Quorum Operator
      9. Strict Order (BEFORE) Operator
      10. NEAR Operator
      11. SENTENCE and PARAGRAPH Operators
      12. ZONE Limit Operator
      13. Keyword Modifiers
    3. Result Set Contents and Limits
    4. Searching Multiple Indexes
    5. Result Set Processing
      1. Expressions
      2. Filtering
      3. Sorting
      4. Grouping
  7. 5. Managing Indexes
    1. The “Divide and Conquer” Concept
    2. Index Rotation
    3. Picking Documents
    4. Handling Updates and Deletions with K-Lists
    5. Scheduling Rebuilds, and Using Multiple Deltas
    6. Merge Versus Rebuild Versus Deltas
    7. Scripting and Reloading Configurations
  8. 6. Relevance and Ranking
    1. Relevance Assessment: A Black Art
    2. Relevance Ranking Functions
    3. Sphinx Rankers Explained
      1. BM25 Factor
      2. Phrase Proximity Factor
      3. Overview of the Available Rankers
      4. Nitty-gritty Ranker Details
      5. How Do I Draw Those Stars?
      6. How Do I Rank Exact Field Matches Higher?
      7. How Do I Force Document D to Rank First?
      8. How Does Sphinx Ranking Compare to System XYZ?
    4. Where to Go from Here
  9. About the Author
  10. Copyright