#!/usr/bin/php U+E1, U+C4->U+E4, U+C5->U+E5, U+C6->U+E6, U+C9->U+E9, U+CD->U+ED, U+D3->U+F3, U+D6->U+F6, U+D8->U+F8, \ U+DA->U+FA, U+DC->U+FC, U+0150->U+0151, U+0152->U+0153, U+0170->U+0171, U+01E2->U+E6, U+01E3->U+E6, U+01FC->U+E6, \ U+01FD->U+E6, U+1D01->U+E6, U+1D02->U+E6, U+1D2D->U+E6, U+1D46->U+E6, \ U+DF, U+E1, U+E4, U+E5, U+E6, U+E9, U+ED, U+00F3, U+F6, U+F8, U+FA, U+FC, U+0151, U+0153, U+0171\n"); // Sphinx 3.3.1 introduced some strict rules for fulltext search column names // In order to comply with it you must enable SPHINX_STRICT_SCHEMA variable // Be sure to check out http://www.mailpiler.org/wiki/current:sphinx3 for more // NB: The SPHINX_STRICT_SCHEMA in sphinx.conf MUST BE THE SAME as in config.php (or in config-site.php) // define('SPHINX_STRICT_SCHEMA', 1); define('RT', 0); if(SPHINX_STRICT_SCHEMA) { define('SELECT_FIELDS', 'id, `from` as sender, `to` as rcpt, `fromdomain` as senderdomain, `todomain` as rcptdomain, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types`'); } else { define('SELECT_FIELDS', 'id, `from`, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types`'); } ?> # # minimal sphinx configuration suited to piler # source base { type = mysql sql_host = MYSQL_HOSTNAME sql_db = MYSQL_DATABASE sql_user = MYSQL_USERNAME sql_pass = MYSQL_PASSWORD sql_attr_uint = size sql_attr_uint = sent sql_attr_uint = attachments } source delta : base { sql_query_pre = SET NAMES utf8mb4 sql_query_pre = REPLACE INTO sph_counter SELECT 1, IFNULL(MAX(id), 0) FROM sph_index sql_query_post_index = DELETE FROM sph_index WHERE id<=(SELECT max_doc_id FROM sph_counter WHERE counter_id=1) sql_query = SELECT FROM sph_index WHERE id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1) sql_query_killlist = SELECT `id` FROM `metadata` WHERE `deleted`=1 sql_query_kbatch = SELECT `id` FROM `metadata` WHERE `deleted`=1 } source main1 : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT FROM sph_index WHERE id=-1 } source main2 : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT FROM sph_index WHERE id=-1 } source main3 : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT FROM sph_index WHERE id=-1 } source main4 : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT FROM sph_index WHERE id=-1 } source dailydelta : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT FROM sph_index WHERE id=-1 } source tag : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT `_id`, `id` AS iid, `uid`, `tag` FROM `tag` sql_attr_uint = iid sql_attr_uint = uid } source note : base { sql_query_pre = SET NAMES utf8mb4 sql_query = SELECT `_id`, `id` AS iid, `uid`, `note` FROM `note` sql_attr_uint = iid sql_attr_uint = uid } index main1 { source = main1 path = /piler/sphinx/main1 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index main2 { source = main2 path = /piler/sphinx/main2 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index main3 { source = main3 path = /piler/sphinx/main3 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index main4 { source = main4 path = /piler/sphinx/main4 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index dailydelta1 { source = dailydelta path = /piler/sphinx/dailydelta1 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index delta1 { source = delta path = /piler/sphinx/delta1 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = = 310) { ?> kbatch = main1, main2, main3, main4, dailydelta1 } index tag1 { source = tag path = /piler/sphinx/tag1 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index note1 { source = note path = /piler/sphinx/note1 docinfo = extern dict = keywords min_prefix_len = 5 min_word_len = 1 charset_table = } index piler1 { type = rt path = /var/piler/sphinx/piler1 rt_mem_limit = 128M rt_field = sender rt_field = rcpt rt_field = senderdomain rt_field = rcptdomain rt_field = subject rt_field = body rt_field = attachment_types rt_attr_bigint = arrived rt_attr_bigint = sent rt_attr_uint = size rt_attr_uint = direction rt_attr_uint = folder rt_attr_uint = attachments } indexer { mem_limit = 256M } searchd { listen = 127.0.0.1:9312 listen = 127.0.0.1:9306:mysql41 log = /dev/null binlog_path = /var/piler/sphinx binlog_max_log_size = 16M binlog_flush = 2 rt_flush_period = 300 ##query_log = read_timeout = 5 max_children = 30 pid_file = /var/run/piler/searchd.pid seamless_rotate = 1 preopen_indexes = 1 unlink_old = 1 thread_stack = 512k workers = thread_pool }