Reader small image

You're reading from  Sphinx Search Beginner's Guide

Product typeBook
Published inMar 2011
Reading LevelIntermediate
Publisher
ISBN-139781849512541
Edition1st Edition
Languages
Right arrow
Author (1)
Abbas Ali
Abbas Ali
author image
Abbas Ali

Abbas Ali has over 15 years of experience in Web 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 and technologies. Amongst various technologies, some of his favorites are Laravel, VueJS, and Sphinx. 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 two daughters, Munira and Zahra. He has lived in Nagpur (India) all his life 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 founded Ranium Systems, a web and mobile development company in 2012 and is currently working as its Chief Executive Officer. The company specializes in development of enterprise level, high performance and scalable web and mobile applications
Read more about Abbas Ali

Right arrow

Time for action - using morphology for stemming


  1. 1. Create the Sphinx configuration file /path/to/sphinx-stem.conf as follows:

    source items
    {
    type = mysql
    sql_host = localhost
    sql_user = root
    sql_pass =
    sql_db = sphinx_conf
    sql_query = SELECT id, title, content, created FROM items
    sql_attr_timestamp = created
    }
    index items
    {
    source = items
    path = /usr/local/sphinx/var/data/items-morph
    charset_type = utf-8
    morphology = stem_en
    }
    
  2. 2. Run the indexer command:

    $/usr/local/sphinx/bin/indexer -c /path/to/sphinx-stem.conf items
    
  3. 3. Search for the word run using the command line search utility:

    $/usr/local/sphinx/bin/search -c /path/to/sphinx-stem.conf run
    
  4. 4. Search for the word running:

    $/usr/local/sphinx/bin/search -c /path/to/sphinx-stem.conf running
    

What just happened?

We created a configuration file to test the morphology option with the value stem_en. We then indexed the data and ran a few searches. Let's try to understand the results.

Firstly we searched for the word run. None of the records in...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Sphinx Search Beginner's Guide
Published in: Mar 2011Publisher: ISBN-13: 9781849512541

Author (1)

author image
Abbas Ali

Abbas Ali has over 15 years of experience in Web 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 and technologies. Amongst various technologies, some of his favorites are Laravel, VueJS, and Sphinx. 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 two daughters, Munira and Zahra. He has lived in Nagpur (India) all his life 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 founded Ranium Systems, a web and mobile development company in 2012 and is currently working as its Chief Executive Officer. The company specializes in development of enterprise level, high performance and scalable web and mobile applications
Read more about Abbas Ali