Translations of this page:

Sphinx for Rotation\Tube sites

There is a good tool to search within big DBs - Sphinx. This a system to perform a fast search with morphological analysis of search query.

Installation:

  • Ask admin to install sphinx itself (this is a separate application)
  • create folder scj/sphinx
  • Add SmartCJ index to Sphinx (usually you have to ask admin to do it). Config example

source scj
{
	type					= mysql

	sql_host				= localhost
	sql_user				= scj_mysql_login
	sql_pass				= scj_mysql_password
	sql_db					= scj_db
	sql_port				= 3306	# optional, default is 3306

	sql_query				= select id, date, tags, alt, description from rot_galleries 

	sql_attr_timestamp		        = date

	sql_query_info			        = SELECT * FROM rot_galleries WHERE id=$id
}


index scj_index
{
	source					= scj
	path					= /path_to_data/scj/sphinx/scj_index
	docinfo					= extern
	morphology                              = stem_en # or stem_ru for example
}



You have to replace with your data following values

scj_mysql_login
scj_mysql_password
scj_db
path_to_data

  • Ask admin to run DB indexer
     indexer --all --rotate 
  • Add to scj/includes/config.php following lines

  $config["sphinx_port"] = 3312; 
  $config["sphinx_search_index"] = 'scj_index';

That's all.

 
ts_sphinx.txt · Last modified: 2010/04/16 10:01 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki