From ff6867d0f4aa9a1e721938fbb1d7fc594ee57bd5 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Mon, 9 Jan 2017 18:08:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C=D1=82=D0=B0=20=D0=B8?= =?UTF-8?q?=D0=BD=D0=B4=D0=B5=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sphinx.conf | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/sphinx.conf b/sphinx.conf index 7e8e9c7..a61dce8 100644 --- a/sphinx.conf +++ b/sphinx.conf @@ -12,6 +12,7 @@ source files_index 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, \ @@ -33,7 +34,6 @@ source files_index sql_attr_string = contentCategory } - index files_index { source = files_index @@ -41,6 +41,23 @@ index files_index 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 @@ -51,6 +68,7 @@ source torrents_index 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, \ @@ -68,7 +86,6 @@ source torrents_index sql_attr_string = contentCategory } - index torrents_index { source = torrents_index @@ -76,6 +93,23 @@ index torrents_index 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 {