sphinx.conf 1.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

source yii2_test_article_src
{
	type			= mysql

	sql_host		= localhost
	sql_user		=
	sql_pass		=
	sql_db			= yii2test
	sql_port		= 3306	# optional, default is 3306

	sql_query		= \
		SELECT *, UNIX_TIMESTAMP(create_date) AS add_date \
		FROM yii2_test_article

	sql_attr_uint		= id
20
	sql_attr_uint		= author_id
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
	sql_attr_timestamp	= add_date

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


source yii2_test_item_src
{
	type			= mysql

	sql_host		= localhost
	sql_user		=
	sql_pass		=
	sql_db			= yii2test
	sql_port		= 3306	# optional, default is 3306

	sql_query		= \
		SELECT *, CURRENT_TIMESTAMP() AS add_date \
		FROM yii2_test_item

	sql_attr_uint		= id
42 43
	sql_attr_uint		= category_id
	sql_attr_float		= price
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
	sql_attr_timestamp	= add_date

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


index yii2_test_article_index
{
	source			= yii2_test_article_src
	path			= /var/lib/sphinx/yii2_test_article_src
	docinfo			= extern
	charset_type	= sbcs
}


index yii2_test_item_index
{
	source			= yii2_test_item_src
	path			= /var/lib/sphinx/yii2_test_item_src
	docinfo			= extern
	charset_type	= sbcs
}


indexer
{
	mem_limit		= 32M
}


searchd
{
	listen			= 127.0.0.1:9312
	listen			= 9306:mysql41
	log				= /var/log/sphinx/searchd.log
	query_log		= /var/log/sphinx/query.log
	read_timeout	= 5
	max_children	= 30
	pid_file		= /var/run/sphinx/searchd.pid
	max_matches		= 1000
	seamless_rotate	= 1
	preopen_indexes	= 1
	unlink_old		= 1
	workers			= threads # for RT to work
	binlog_path		= /var/lib/sphinx
}