This shows you the differences between two versions of the page.
ts_sphinx [2014/01/29 18:05] |
ts_sphinx [2014/01/29 18:05] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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, crc32(g.gallery_md5) as gallery_md5_crc, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | sql_attr_timestamp = date | ||
+ | sql_attr_uint | ||
+ | sql_attr_uint | ||
+ | sql_attr_uint | ||
+ | sql_attr_float | ||
+ | sql_attr_uint | ||
+ | sql_attr_uint = gallery_md5_crc | ||
+ | |||
+ | sql_query_info | ||
+ | } | ||
+ | |||
+ | |||
+ | index scj_index | ||
+ | { | ||
+ | source = scj | ||
+ | path = / | ||
+ | docinfo = extern | ||
+ | morphology | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | 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 < | ||
+ | * Add to scj/ | ||
+ | < | ||
+ | $config[" | ||
+ | $config[" | ||
+ | </ | ||
+ | |||
+ | That's all. |