www.webdeveloper.com
Results 1 to 2 of 2

Thread: Sphinx search doesn't always find words

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    London
    Posts
    410

    Unhappy Sphinx search doesn't always find words

    Hi all,

    I'm having a problem with Sphinx Search where if I have a document with a title "Laser applications" and I use the command
    Code:
    search -i per_projects -a laser -q
    I get no results yet if I use MySQL to search for
    Code:
    SELECT * FROM projects AS Project WHERE Project.title LIKE "%laser%";
    I get two hits. This has happened for lots of other search queries for other documents. Sometimes it works really well, sometimes it doesn't.

    Here's a snippet from my Sphinx.conf if it helps:

    Code:
    source per
    {
    	type			= mysql
    	sql_host		= localhost
    	sql_user		= user
    	sql_pass		= password
    	sql_db		= database
    	sql_sock		= /var/run/mysqld/mysqld.sock
    	sql_port		= 3306
    }
    
    source per_projects : per
    {
    	# For delta indexing:
    	
    	sql_query_pre	= REPLACE INTO sph_counter SELECT 1, MAX(Project.id) FROM projects AS Project;
    	
    	# indexer query
    
    	sql_query		= SELECT Project.id, Project.title, Project.description FROM projects AS Project \
    						WHERE Project.id <= (SELECT max_item_id FROM sph_counter WHERE counter_id = 1);
    
    	# info query
    
    	sql_query_info	= SELECT * FROM projects AS Project WHERE Project.id=$id;
    }
    
    source projects_delta : per
    {
    	# indexer query
    	
        sql_query		= SELECT Project.id, Project.title, Project.description FROM projects AS Project \
    						WHERE Project.id > (SELECT max_item_id FROM sph_counter WHERE counter_id = 1);
    	
    	# document info query
    	
    	sql_query_info	= SELECT * FROM projects AS Project WHERE Project.id=$id;
    }
    
    index per_projects
    {
    	source				= per_projects
    	path				= /var/data/sphinx/per_projects.index
    	
    	morphology			= stem_en, metaphone
    	min_stemming_len	= 4
    	
    	stopwords			= /usr/local/etc/sph_stopwords.txt
    	
    	min_word_len		= 3
    	min_infix_len		= 3
    	infix_fields		= title
    	enable_star			= 1
    }
    
    index projects_delta : per_projects
    {
    	source			= projects_delta
    	path			= /var/data/sphinx/projects_delta.index
    }
    
    searchd
    {
    	port			= 3312
    	log				= /var/log/searchd/searchd.log
    	query_log		= /var/log/searchd/query.log
    	pid_file		= /var/log/searchd/searchd.pid
    }

  2. #2
    Join Date
    Aug 2007
    Location
    London
    Posts
    410
    Does anyone know why Sphinx is behaving like this? Maybe I have some weird config options or something? Please?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles