rats-search/sphinx.conf
2017-01-09 18:08:42 +03:00

134 lines
3.4 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 = REPLACE INTO sphinx_counter SELECT 1, MAX(fileid) FROM torrents
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 \
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
}
index files_index
{
source = files_index
path = /var/lib/sphinx/files
min_word_len = 3
}
source files_index_delta : files_index
{
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 \
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/data/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 = 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 \
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
}
index torrents_index
{
source = torrents_index
path = /var/lib/sphinx/torrents
min_word_len = 3
}
source torrents_index_delta : torrents_index
{
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 \
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/data/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/
}