Sphinx の起動時に次の警告が表示されます。
警告: compat_sphinxql_magics=1 は非推奨です。アプリケーションと構成を更新してください警告: インデックス 'デルタ': ロック: C:\Sphinx\conf\sphinx_test.spl をロックできませんでした: そのようなファイルまたはディレクトリはありません。インデックスは使用できません
設定ファイル
source main
{
...MYSQL options...
sql_query_pre = UPDATE delta_index SET last_index_time = NOW() WHERE counter_id = 1;
sql_query_pre = SET @a := 0;
sql_query_pre = SET NAMES utf8
sql_query = \
SELECT @a := @a + 1 AS id, m.message_id AS mid, user_see.user_id AS user_see_id, ms.message_stream_id AS msid, \
d.name AS dname, m.text AS mtext, CONCAT(user_write.first_name, ' ', user_write.last_name) AS name, ms.subject AS subj \
FROM message_stream AS ms \
INNER JOIN message m \
ON m.message_stream_id = ms.message_stream_id \
INNER JOIN user user_write \
ON m.user_id = user_write.user_id \
INNER JOIN message_stream_has_basket mshb \
ON ms.message_stream_id = mshb.message_stream_id \
INNER JOIN basket b \
ON mshb.basket_id = b.basket_id \
INNER JOIN department d \
ON b.department_id = d.department_id \
INNER JOIN user_has_department uhd \
ON uhd.department_id = d.department_id \
INNER JOIN user user_see \
ON uhd.user_id = user_see.user_id \
WHERE (b.user_id IS NULL OR uhd.user_id = b.user_id \
AND m.date_created <= (SELECT last_index_time FROM delta_index WHERE counter_id = 1))
sql_attr_uint = user_see_id
sql_attr_uint = mid
sql_attr_uint = msid
}
source delta : main
{
sql_query_pre = SET NAMES utf8
sql_query = \
SELECT @a := @a + 1 AS id, m.message_id AS mid, user_see.user_id AS user_see_id, ms.message_stream_id AS msid, \
d.name AS dname, m.text AS mtext, CONCAT(user_write.first_name, ' ', user_write.last_name) AS name, ms.subject AS subj \
FROM message_stream AS ms \
INNER JOIN message m \
ON m.message_stream_id = ms.message_stream_id \
INNER JOIN user user_write \
ON m.user_id = user_write.user_id \
INNER JOIN message_stream_has_basket mshb \
ON ms.message_stream_id = mshb.message_stream_id \
INNER JOIN basket b \
ON mshb.basket_id = b.basket_id \
INNER JOIN department d \
ON b.department_id = d.department_id \
INNER JOIN user_has_department uhd \
ON uhd.department_id = d.department_id \
INNER JOIN user user_see \
ON uhd.user_id = user_see.user_id \
WHERE ((b.user_id IS NULL OR uhd.user_id = b.user_id) \
AND m.date_created > (SELECT last_index_time FROM delta_index WHERE counter_id = 1))
sql_attr_uint = user_see_id
sql_attr_uint = mid
sql_attr_uint = msid
}
index main
{
source = main
path = C:\Sphinx\conf\sphinx_test
docinfo = extern
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, a..z, -, \
U+00C1->U+00E1, U+00C9->U+00E9, U+00CD->U+00ED, \
U+00D3->U+00F3, U+00D6->U+00F6, U+0150->U+0151, \
U+00DA->U+00FA, U+00DC->U+00FC, U+0170->U+0171, \
U+00E1, U+00E9, U+00ED, U+00F3, U+00F6, U+0151, \
U+00FA, U+00FC, U+0171
min_word_len = 2
enable_star = 1
min_prefix_len = 2
}
index delta : main
{
source = delta
path = C:\Sphinx\conf\sphinx_test
docinfo = extern
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, a..z, -, \
U+00C1->U+00E1, U+00C9->U+00E9, U+00CD->U+00ED, \
U+00D3->U+00F3, U+00D6->U+00F6, U+0150->U+0151, \
U+00DA->U+00FA, U+00DC->U+00FC, U+0170->U+0171, \
U+00E1, U+00E9, U+00ED, U+00F3, U+00F6, U+0151, \
U+00FA, U+00FC, U+0171
min_word_len = 2
enable_star = 1
min_prefix_len = 2
}
indexer
{
mem_limit = 32M
}
# searchd options (used by search daemon)
searchd{
listen = 9310
log = C:\Sphinx\conf\searchd.log
query_log = C:\Sphinx\conf\query.log
max_children = 30
pid_file = C:\Sphinx\conf\searchd.pid
}
メイン + デルタ インデックスを実行しています。すべて問題ありません。検索エンジンは検索を行っており、適切な検索結果が得られています。
C:\Sphinx\bin>indexer --config C:\Sphinx\conf\sphinx_test.conf main delta
その後、デルタ インデックスを実行しています。インデックスには適切なドキュメント (新しいドキュメントのみ) がありますが、検索エンジンが失敗し、結果がありません。デルタがメインをオーバーライドするようです。(メインとデルタの検索を実行しています)
C:\Sphinx\bin>indexer --config C:\Sphinx\conf\sphinx_test.conf delta
C:\Sphinx\bin>searchd --config C:\Sphinx\conf\sphinx_test.conf