2022-08-27 11:03:29 +02:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
define('LOCALSTATEDIR', '/var');
|
|
|
|
define('NGRAM_CONFIG', " #ngram_len = 1\n #ngram_chars = U+3000..U+2FA1F\n");
|
|
|
|
|
|
|
|
# See http://sphinxsearch.com/wiki/doku.php?id=charset_tables for more on the charset_table settings
|
|
|
|
# The following settings contains English and some Latin extras
|
|
|
|
define('CHARSET_TABLE', "0..9, english, _, \
|
|
|
|
U+C1->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");
|
|
|
|
|
|
|
|
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`');
|
|
|
|
|
2022-08-27 19:23:21 +02:00
|
|
|
define('RT', 0);
|
|
|
|
|
2022-08-27 11:03:29 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
#
|
2022-12-31 09:04:16 +01:00
|
|
|
# minimal manticore configuration suited to piler
|
2022-08-27 11:03:29 +02:00
|
|
|
#
|
|
|
|
|
2022-12-31 09:04:16 +01:00
|
|
|
<?php if(RT == 0) { ?>
|
|
|
|
|
2022-08-27 11:03:29 +02:00
|
|
|
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 <?php print SELECT_FIELDS; ?> 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
|
|
|
|
}
|
|
|
|
|
|
|
|
source main1 : base
|
|
|
|
{
|
|
|
|
sql_query_pre = SET NAMES utf8mb4
|
|
|
|
sql_query = SELECT <?php print SELECT_FIELDS; ?> FROM sph_index WHERE id=-1
|
|
|
|
}
|
|
|
|
|
|
|
|
source main2 : base
|
|
|
|
{
|
|
|
|
sql_query_pre = SET NAMES utf8mb4
|
|
|
|
sql_query = SELECT <?php print SELECT_FIELDS; ?> FROM sph_index WHERE id=-1
|
|
|
|
}
|
|
|
|
|
|
|
|
source main3 : base
|
|
|
|
{
|
|
|
|
sql_query_pre = SET NAMES utf8mb4
|
|
|
|
sql_query = SELECT <?php print SELECT_FIELDS; ?> FROM sph_index WHERE id=-1
|
|
|
|
}
|
|
|
|
|
|
|
|
source main4 : base
|
|
|
|
{
|
|
|
|
sql_query_pre = SET NAMES utf8mb4
|
|
|
|
sql_query = SELECT <?php print SELECT_FIELDS; ?> FROM sph_index WHERE id=-1
|
|
|
|
}
|
|
|
|
|
|
|
|
source dailydelta : base
|
|
|
|
{
|
|
|
|
sql_query_pre = SET NAMES utf8mb4
|
|
|
|
sql_query = SELECT <?php print SELECT_FIELDS; ?> FROM sph_index WHERE id=-1
|
|
|
|
}
|
|
|
|
|
|
|
|
index main1
|
|
|
|
{
|
|
|
|
source = main1
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/main1
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
index main2
|
|
|
|
{
|
|
|
|
source = main2
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/main2
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
index main3
|
|
|
|
{
|
|
|
|
source = main3
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/main3
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
index main4
|
|
|
|
{
|
|
|
|
source = main4
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/main4
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
index dailydelta1
|
|
|
|
{
|
|
|
|
source = dailydelta
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/dailydelta1
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2023-09-27 19:13:20 +02:00
|
|
|
killlist_target = main1:kl, main2:kl, main3:kl, main4:kl, dailydelta1:kl
|
2022-08-27 11:03:29 +02:00
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
index delta1
|
|
|
|
{
|
|
|
|
source = delta
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/delta1
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
2022-12-10 19:23:14 +01:00
|
|
|
stored_fields =
|
2022-08-27 11:03:29 +02:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
2022-08-27 19:42:49 +02:00
|
|
|
source tag : base
|
2022-08-27 19:23:21 +02:00
|
|
|
{
|
2022-08-27 19:42:49 +02:00
|
|
|
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
|
2022-08-27 19:23:21 +02:00
|
|
|
}
|
|
|
|
|
2022-08-27 19:42:49 +02:00
|
|
|
source note : base
|
2022-08-27 19:23:21 +02:00
|
|
|
{
|
2022-08-27 19:42:49 +02:00
|
|
|
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
|
2022-08-27 19:23:21 +02:00
|
|
|
}
|
|
|
|
|
2022-08-27 19:42:49 +02:00
|
|
|
index tag1
|
|
|
|
{
|
|
|
|
source = tag
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/tag1
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2022-08-27 20:01:19 +02:00
|
|
|
stored_fields =
|
2022-08-27 19:42:49 +02:00
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
index note1
|
|
|
|
{
|
|
|
|
source = note
|
|
|
|
path = <?php print LOCALSTATEDIR; ?>/piler/manticore/note1
|
|
|
|
min_prefix_len = 5
|
|
|
|
min_word_len = 1
|
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2022-08-27 20:01:19 +02:00
|
|
|
stored_fields =
|
2022-08-27 19:42:49 +02:00
|
|
|
<?php print NGRAM_CONFIG; ?>
|
|
|
|
}
|
2022-08-27 19:23:21 +02:00
|
|
|
|
2022-12-31 08:08:31 +01:00
|
|
|
<?php } else { ?>
|
2022-08-27 19:23:21 +02:00
|
|
|
|
2022-12-31 08:08:31 +01:00
|
|
|
index piler1
|
2022-08-27 11:03:29 +02:00
|
|
|
{
|
2022-12-31 08:08:31 +01:00
|
|
|
type = rt
|
|
|
|
path = /var/piler/manticore/piler1
|
|
|
|
rt_mem_limit = 512M
|
|
|
|
stored_fields =
|
2022-12-31 09:04:16 +01:00
|
|
|
min_word_len = 1
|
2022-12-31 08:08:31 +01:00
|
|
|
min_prefix_len = 5
|
2022-12-31 09:53:14 +01:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2022-12-31 08:08:31 +01:00
|
|
|
# See https://manual.manticoresearch.com/Creating_an_index/Data_types#Row-wise-and-columnar-attribute-storages
|
|
|
|
# if you want to enable columnar storage
|
|
|
|
# columnar_attrs = *
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
index tag1
|
|
|
|
{
|
|
|
|
type = rt
|
|
|
|
path = /var/piler/manticore/tag1
|
2022-12-31 09:53:14 +01:00
|
|
|
rt_mem_limit = 16M
|
2022-12-31 08:08:31 +01:00
|
|
|
stored_fields = tag
|
2022-12-31 09:53:14 +01:00
|
|
|
min_word_len = 2
|
2022-12-31 08:08:31 +01:00
|
|
|
min_prefix_len = 5
|
2022-12-31 09:53:14 +01:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2022-12-31 08:08:31 +01:00
|
|
|
rt_field = tag
|
|
|
|
rt_attr_bigint = mid
|
|
|
|
rt_attr_uint = uid
|
2022-08-27 11:03:29 +02:00
|
|
|
}
|
|
|
|
|
2022-12-31 08:08:31 +01:00
|
|
|
index note1
|
|
|
|
{
|
|
|
|
type = rt
|
|
|
|
path = /var/piler/manticore/note1
|
2022-12-31 09:53:14 +01:00
|
|
|
rt_mem_limit = 16M
|
2022-12-31 08:08:31 +01:00
|
|
|
stored_fields = note
|
2022-12-31 09:53:14 +01:00
|
|
|
min_word_len = 2
|
2022-12-31 08:08:31 +01:00
|
|
|
min_prefix_len = 5
|
2022-12-31 09:53:14 +01:00
|
|
|
charset_table = <?php print CHARSET_TABLE; ?>
|
2022-12-31 08:08:31 +01:00
|
|
|
rt_field = note
|
|
|
|
rt_attr_bigint = mid
|
|
|
|
rt_attr_uint = uid
|
|
|
|
}
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
2022-08-27 11:03:29 +02:00
|
|
|
|
|
|
|
searchd
|
|
|
|
{
|
|
|
|
listen = 127.0.0.1:9312
|
|
|
|
listen = 127.0.0.1:9306:mysql41
|
|
|
|
log = /var/piler/manticore/manticore.log
|
2022-08-27 19:23:21 +02:00
|
|
|
binlog_max_log_size = 256M
|
|
|
|
binlog_path = /var/piler/manticore
|
|
|
|
binlog_flush = 2
|
2022-08-27 11:03:29 +02:00
|
|
|
query_log = /var/piler/manticore/query.log
|
|
|
|
network_timeout = 5
|
|
|
|
pid_file = /var/run/piler/searchd.pid
|
|
|
|
seamless_rotate = 1
|
2023-03-19 18:13:36 +01:00
|
|
|
preopen_tables = 1
|
2022-08-27 11:03:29 +02:00
|
|
|
unlink_old = 1
|
|
|
|
thread_stack = 512k
|
2022-08-27 19:23:21 +02:00
|
|
|
<?php if(RT) { ?>
|
|
|
|
rt_flush_period = 300
|
|
|
|
<?php } ?>
|
|
|
|
|
2022-08-27 11:03:29 +02:00
|
|
|
}
|