Manticore Search supports the use of special suffixes to simplify numeric values with specific meanings. These suffixes are categorized into size suffixes and time suffixes. The common format for suffixes is an integer
followed by a literal
, such as 10k
or 100d
. Literals are case-insensitive, so 10W
and 10w
are considered the same.
-
Size suffixes: These suffixes can be used in settings that define the size of something, such as memory buffer, disk file size, or RAM limit. If no suffix is specified, the value is considered in bytes by default. The available size suffixes are:
k
for kilobytes (1k = 1024 bytes)m
for megabytes (1m = 1024k)g
for gigabytes (1g = 1024m)t
for terabytes (1t = 1024g)
-
Time suffixes: These suffixes can be used in settings that define time interval values, such as delays or timeouts. Unadorned values for these parameters usually have a documented scale, but instead of guessing, you can use an explicit suffix. The available time suffixes are:
us
for microsecondsms
for millisecondss
for secondsm
for minutesh
for hoursd
for daysw
for weeks
Manticore configuration supports shebang syntax, allowing the configuration to be written in a programming language and interpreted at loading. This enables dynamic settings, such as generating tables by querying a database table, modifying settings based on external factors, or including external files containing table and source declarations.
The configuration file is parsed by the declared interpreter, and the output is used as the actual configuration. This occurs each time the configuration is read, not only at searchd startup.
Note: This feature is not available on the Windows platform.
In the following example, PHP is used to create multiple tables with different names and to scan a specific folder for files containing extra table declarations:
#!/usr/bin/php
...
<?php for ($i=1; $i<=6; $i++) { ?>
table test_<?=$i?> {
type = rt
path = /var/lib/manticore/data/test_<?=$i?>
rt_field = subject
...
}
<?php } ?>
...
<?php
$confd_folder='/etc/manticore.conf.d/';
$files = scandir($confd_folder);
foreach($files as $file)
{
if(($file == '.') || ($file =='..'))
{} else {
$fp = new SplFileInfo($confd_folder.$file);
if('conf' == $fp->getExtension()){
include ($confd_folder.$file);
}
}
}
?>
Manticore Search's configuration file supports comments, which help provide explanations or notes within the configuration file. The #
character is used to start a comment section. You can place the comment character either at the beginning of a line or inline within a line.
When using comments, be cautious when incorporating the #
character in character tokenization settings, as everything following it will be ignored. To prevent this, use the #
UTF-8 code, which is U+23.
If you need to use the #
character within your configuration file, such as within database credentials in source declarations, you can escape it using a backslash \
. This allows you to include the #
character in your settings without it being interpreted as the start of a comment.