148 lines
4.0 KiB
Plaintext
148 lines
4.0 KiB
Plaintext
#
|
|
# Minimal Sphinx configuration sample (clean, simple, functional)
|
|
#
|
|
|
|
source files_index
|
|
{
|
|
type = mysql
|
|
|
|
sql_host = localhost
|
|
sql_user = btsearch
|
|
sql_pass = pirateal100x
|
|
sql_db = btsearch
|
|
sql_port = 3306 # optional, default is 3306
|
|
|
|
sql_query_pre = SET NAMES utf8
|
|
sql_query_pre = REPLACE INTO sphinx_counter SELECT 1, MAX(fileid) FROM files
|
|
sql_query = \
|
|
SELECT fls.fileid, fls.path, fls.size as filesize, \
|
|
torrents.hash as hash, torrents.name as name, torrents.size as size, \
|
|
torrents.seeders, torrents.leechers, torrents.completed, \
|
|
torrents.files, torrents.contentType, torrents.contentCategory, \
|
|
torrents.good, torrents.bad, UNIX_TIMESTAMP(torrents.added) AS added \
|
|
FROM files as fls INNER JOIN torrents ON(torrents.hash = fls.hash)
|
|
|
|
sql_field_string = path
|
|
sql_attr_string = hash
|
|
sql_attr_bigint = filesize
|
|
|
|
sql_attr_string = name
|
|
sql_attr_bigint = size
|
|
sql_attr_uint = files
|
|
sql_attr_uint = seeders
|
|
sql_attr_uint = leechers
|
|
sql_attr_uint = completed
|
|
sql_attr_string = contentType
|
|
sql_attr_string = contentCategory
|
|
sql_attr_uint = good
|
|
sql_attr_uint = bad
|
|
sql_attr_timestamp = added
|
|
}
|
|
|
|
index files_index
|
|
{
|
|
source = files_index
|
|
path = /var/lib/sphinx/files
|
|
min_word_len = 3
|
|
}
|
|
|
|
source files_index_delta : files_index
|
|
{
|
|
sql_query_pre = SET NAMES utf8
|
|
sql_query = \
|
|
SELECT fls.fileid, fls.path, fls.size as filesize, \
|
|
torrents.hash as hash, torrents.name as name, torrents.size as size, \
|
|
torrents.seeders, torrents.leechers, torrents.completed, \
|
|
torrents.files, torrents.contentType, torrents.contentCategory, \
|
|
torrents.good, torrents.bad, UNIX_TIMESTAMP(torrents.added) AS added \
|
|
FROM files as fls INNER JOIN torrents ON(torrents.hash = fls.hash) \
|
|
WHERE fls.fileid > ( SELECT max_doc_id FROM sphinx_counter WHERE counter_id = 1 )
|
|
}
|
|
|
|
index files_index_delta : files_index
|
|
{
|
|
source = files_index_delta
|
|
path = /var/lib/sphinx/files.delta
|
|
}
|
|
|
|
source torrents_index
|
|
{
|
|
type = mysql
|
|
|
|
sql_host = localhost
|
|
sql_user = btsearch
|
|
sql_pass = pirateal100x
|
|
sql_db = btsearch
|
|
sql_port = 3306 # optional, default is 3306
|
|
|
|
sql_query_pre = SET NAMES utf8
|
|
sql_query_pre = REPLACE INTO sphinx_counter SELECT 2, MAX(torrentid) FROM torrents
|
|
sql_query = \
|
|
SELECT torrents.torrentid, torrents.hash as hash, torrents.name as name, torrents.size as size, \
|
|
torrents.seeders, torrents.leechers, torrents.completed, \
|
|
torrents.files, torrents.contentType, torrents.contentCategory, \
|
|
torrents.good, torrents.bad, UNIX_TIMESTAMP(torrents.added) AS added \
|
|
FROM torrents
|
|
|
|
sql_attr_string = hash
|
|
sql_field_string = name
|
|
sql_attr_bigint = size
|
|
sql_attr_uint = files
|
|
sql_attr_uint = seeders
|
|
sql_attr_uint = leechers
|
|
sql_attr_uint = completed
|
|
sql_attr_string = contentType
|
|
sql_attr_string = contentCategory
|
|
sql_attr_uint = good
|
|
sql_attr_uint = bad
|
|
sql_attr_timestamp = added
|
|
}
|
|
|
|
index torrents_index
|
|
{
|
|
source = torrents_index
|
|
path = /var/lib/sphinx/torrents
|
|
min_word_len = 3
|
|
}
|
|
|
|
source torrents_index_delta : torrents_index
|
|
{
|
|
sql_query_pre = SET NAMES utf8
|
|
sql_query = \
|
|
SELECT torrents.torrentid, torrents.hash as hash, torrents.name as name, torrents.size as size, \
|
|
torrents.seeders, torrents.leechers, torrents.completed, \
|
|
torrents.files, torrents.contentType, torrents.contentCategory, \
|
|
torrents.good, torrents.bad, UNIX_TIMESTAMP(torrents.added) AS added \
|
|
FROM torrents \
|
|
WHERE torrents.torrentid > ( SELECT max_doc_id FROM sphinx_counter WHERE counter_id = 2 )
|
|
}
|
|
|
|
index torrents_index_delta : torrents_index
|
|
{
|
|
source = torrents_index_delta
|
|
path = /var/lib/sphinx/torrents.delta
|
|
}
|
|
|
|
|
|
|
|
indexer
|
|
{
|
|
mem_limit = 128M
|
|
}
|
|
|
|
searchd
|
|
{
|
|
listen = 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
|
|
seamless_rotate = 1
|
|
preopen_indexes = 1
|
|
unlink_old = 1
|
|
workers = threads # for RT to work
|
|
binlog_path = /var/lib/sphinx/
|
|
}
|