sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
sudo yum install manticore manticore-extra
sudo yum --setopt=tsflags=noscripts remove manticore*
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
sudo apt install manticore manticore-extra
sudo apt remove manticore*
brew install manticoresoftware/tap/manticoresearch manticoresoftware/tap/manticore-extra
docker run -e EXTRA=1 --name manticore --rm -d manticoresearch/manticore && echo "Waiting for Manticore docker to start. Consider mapping the data_dir to make it start faster next time" && until docker logs manticore 2>&1 | grep -q "accepting connections"; do sleep 1; echo -n .; done && echo && docker exec -it manticore mysql && docker stop manticore
docker run -e EXTRA=1 --name manticore -v $(pwd)/data:/var/lib/manticore -p 127.0.0.1:9306:9306 -p 127.0.0.1:9308:9308 -d manticoresearch/manticore
Docker images of Manticore Search are publicly accessible on Docker Hub, built from the Manticore Search docker GitHub repository.
To retrieve the Manticore image, run the following command:
docker pull manticoresearch/manticore
For more information about using Manticore in Docker, see the Using Manticore in Docker section.
The simplest method to install Manticore on RedHat/CentOS is by using our YUM repository:
Install the repository:
sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
Then install Manticore Search:
sudo yum install manticore manticore-extra
If you are upgrading to Manticore 6 from an older version, it is recommended to remove your old packages first to avoid conflicts caused by the updated package structure:
sudo yum remove manticore*
It won't remove your data and configuration file.
If you prefer "Nightly" (development) versions do:
sudo yum -y install https://repo.manticoresearch.com/manticore-repo.noarch.rpm && \
sudo yum -y --enablerepo manticore-dev install manticore manticore-extra manticore-common manticore-server manticore-server-core manticore-tools manticore-executor manticore-buddy manticore-backup manticore-columnar-lib manticore-server-core-debuginfo manticore-tools-debuginfo manticore-columnar-lib-debuginfo manticore-icudata manticore-galera manticore-galera-debuginfo
To download standalone RPM files from the Manticore repository, follow the instructions available at https://manticoresearch.com/install/.
If you plan to use indexer to create tables from external sources, you'll need to make sure you have installed corresponding client libraries in order to make available of indexing sources you want. The line below will install all of them at once; feel free to use it as is, or to reduce it to install only libraries you need (for only mysql sources - just mysql-libs
should be enough, and unixODBC is not necessary).
sudo yum install mysql-libs postgresql-libs expat unixODBC
In CentOS Stream 8 you may need to run:
dnf install mariadb-connector-c
if you get error sql_connect: MySQL source wasn't initialized. Wrong name in dlopen?
trying to build a plain table from MySQL.
The lemmatizer requires Python 3.9+. Make sure you have it installed and that it's configured with --enable-shared
.
Here's how to install Python 3.9 and the Ukrainian lemmatizer in Centos 7/8:
# install Manticore Search and UK lemmatizer from YUM repository
yum -y install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
yum -y install manticore manticore-lemmatizer-uk
# install packages needed for building Python
yum groupinstall "Development Tools" -y
yum install openssl-devel libffi-devel bzip2-devel wget -y
# download, build and install Python 3.9
cd ~
wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz
tar xvf Python-3.9.2.tgz
cd Python-3.9*/
./configure --enable-optimizations --enable-shared
make -j8 altinstall
# update linker cache
ldconfig
# install pymorphy2 and UK dictionary
pip3.9 install pymorphy2[fast]
pip3.9 install pymorphy2-dicts-uk
12.0 (Bookworm)
Ubuntu
22.04 (Ubuntu Jammy)
Mint
The easiest way to install Manticore in Ubuntu/Debian/Mint is by using our APT repository.
Install the repository:
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
(install wget
if it's not installed; install gnupg2
if apt-key
fails).
Then install Manticore Search:
sudo apt install manticore manticore-extra
If you are upgrading to Manticore 6 from an older version, it is recommended to remove your old packages first to avoid conflicts caused by the updated package structure:
sudo apt remove manticore*
It won't remove your data and configuration file.
If you prefer "Nightly" (development) versions do:
wget https://repo.manticoresearch.com/manticore-dev-repo.noarch.deb && \
sudo dpkg -i manticore-dev-repo.noarch.deb && \
sudo apt -y update && \
sudo apt -y install manticore manticore-extra manticore-common manticore-server manticore-server-core manticore-tools manticore-executor manticore-buddy manticore-backup manticore-columnar-lib manticore-server-core-dbgsym manticore-tools-dbgsym manticore-columnar-lib-dbgsym manticore-icudata-65l manticore-galera manticore-galera-dbgsym
To download standalone DEB files from the Manticore repository, follow the instructions available at https://manticoresearch.com/install/.
Manticore package depends on zlib and ssl libraries, nothing else is strictly required. However, if you plan to use indexer to create tables from external storages, you'll need to install appropriate client libraries. To find out what specific libraries indexer
requires, run it and look at the top of its output:
$ sudo -u manticore indexer
Manticore 3.5.4 13f8d08d@201211 release
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2024, Manticore Software LTD (https://manticoresearch.com)
Built by gcc/clang v 5.4.0,
Built on Linux runner-0277ea0f-project-3858465-concurrent-0 4.19.78-coreos #1 SMP Mon Oct 14 22:56:39 -00 2019 x86_64 x86_64 x86_64 GNU/Linux
Configured by CMake with these definitions: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISTR_BUILD=xenial -DUSE_SSL=ON -DDL_UNIXODBC=1 -DUNIXODBC_LIB=libodbc.so.2 -DDL_EXPAT=1 -DEXPAT_LIB=libexpat.so.1 -DUSE_LIBICONV=1 -DDL_MYSQL=1 -DMYSQL_LIB=libmysqlclient.so.20 -DDL_PGSQL=1 -DPGSQL_LIB=libpq.so.5 -DLOCALDATADIR=/var/data -DFULL_SHARE_DIR=/usr/share/manticore -DUSE_ICU=1 -DUSE_BISON=ON -DUSE_FLEX=ON -DUSE_SYSLOG=1 -DWITH_EXPAT=1 -DWITH_ICONV=ON -DWITH_MYSQL=1 -DWITH_ODBC=ON -DWITH_POSTGRESQL=1 -DWITH_RE2=1 -DWITH_STEMMER=1 -DWITH_ZLIB=ON -DGALERA_SOVERSION=31 -DSYSCONFDIR=/etc/manticoresearch
Here you can see mentions of libodbc.so.2, libexpat.so.1, libmysqlclient.so.20, and libpq.so.5.
Below is a reference table with a list of all the client libraries for different Debian/Ubuntu versions:
Distr | MySQL | PostgreSQL | XMLpipe | UnixODBC |
---|---|---|---|---|
Ubuntu Trusty | libmysqlclient.so.18 | libpq.so.5 | libexpat.so.1 | libodbc.so.1 |
Ubuntu Bionic | libmysqlclient.so.20 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Ubuntu Focal | libmysqlclient.so.21 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Ubuntu Hirsute | libmysqlclient.so.21 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Ubuntu Jammy | libmysqlclient.so.21 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Debian Jessie | libmysqlclient.so.18 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Debian Buster | libmariadb.so.3 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Debian Bullseye | libmariadb.so.3 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
Debian Bookworm | libmariadb.so.3 | libpq.so.5 | libexpat.so.1 | libodbc.so.2 |
To find packages that provide the libraries, you can use, for example, apt-file
:
apt-file find libmysqlclient.so.20
libmysqlclient20: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
libmysqlclient20: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.2.0
libmysqlclient20: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.6
Note that you only need libraries for the types of storages you're going to use. So if you plan to build tables only from MySQL, then you might need to install only the MySQL library (in the above case libmysqlclient20
).
Finally, install the needed packages:
sudo apt-get install libmysqlclient20 libodbc1 libpq5 libexpat1
If you aren't going to use the indexer
tool at all, you don't need to find and install any libraries.
To enable CJK tokenization support, the official packages contain binaries with embedded ICU library and include ICU data file. They are independent from any ICU runtime library which might be available on your system, and can't be upgraded.
The lemmatizer requires Python 3.9+. Make sure you have it installed and that it's configured with --enable-shared
.
Here's how to install Python 3.9 and the Ukrainian lemmatizer on Debian and Ubuntu:
# install Manticore Search and UK lemmatizer from APT repository
cd ~
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt -y update
sudo apt -y install manticore manticore-lemmatizer-uk
# install packages needed for building Python
sudo apt -y update
sudo apt -y install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
# download, build and install Python 3.9
cd ~
wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz
tar xzf Python-3.9.4.tgz
cd Python-3.9.4
./configure --enable-optimizations --enable-shared
sudo make -j8 altinstall
# update linker cache
sudo ldconfig
# install pymorphy2 and UK dictionary
sudo pip3.9 install pymorphy2[fast]
sudo pip3.9 install pymorphy2-dicts-uk
brew install manticoresoftware/tap/manticoresearch manticoresoftware/tap/manticore-extra
Start Manticore as a brew service:
brew services start manticoresearch
The default configuration file for Manticore is located at either /usr/local/etc/manticoresearch/manticore.conf
or /opt/homebrew/etc/manticoresearch/manticore.conf
.
If you plan to use indexer to fetch data from sources such as MySQL, PostgreSQL, or another database using ODBC, you may need additional libraries, such as mysql@5.7
, libpq
, and unixodbc
, respectively.
If you prefer "Nightly" (development) versions do:
brew tap manticoresoftware/tap-dev
brew install manticoresoftware/tap-dev/manticoresearch-dev manticoresoftware/tap-dev/manticore-extra-dev
brew services start manticoresearch-dev
manticore.conf
file in RT mode. No additional configuration is required.To install searchd
(Manticore Search server) as a Windows service, run:
\path\to\searchd.exe --install --config \path\to\config --servicename Manticore
Make sure to use the full path of the configuration file, otherwise searchd.exe
will not be able to locate it when it starts as a service.
After installation, the service can be started from the Services snap-in of the Microsoft Management Console.
Once started, you can access Manticore using the MySQL command line interface:
mysql -P9306 -h127.0.0.1
Note that in most examples in this manual, we use -h0
to connect to the local host, but in Windows, you must use localhost
or 127.0.0.1
explicitly.
Compiling Manticore Search from sources enables custom build configurations, such as disabling certain features or adding new patches for testing. For example, you may want to compile from sources and disable the embedded ICU in order to use a different version installed on your system that can be upgraded independently of Manticore. This is also useful if you are interested in contributing to the Manticore Search project.
To prepare official release and development packages, we use Docker and a special building image. This image includes essential tooling and is designed to be used with external sysroots, so one container can build packages for all operating systems. You can build the image using the Dockerfile and README or use an image from Docker Hub. This is the easiest way to create binaries for any supported operating system and architecture. You'll also need to specify the following environment variables when running the container:
DISTR
: the target platformarch
: the architectureSYSROOT_URL
: the URL to the system roots archives. You can use https://repo.manticoresearch.com/repository/sysroots unless you are building the sysroots yourself (instructions can be found here).To find possible values for DISTR
and arch
, you can use the directory https://repo.manticoresearch.com/repository/sysroots/roots_with_zstd/ as a reference, as it includes sysroots for all supported combinations.
After that, building packages inside the Docker container is as easy as calling:
cmake -DPACK=1 /path/to/sources
cmake --build .
For instance, to create a package for RHEL7-compatible operating systems that is similar to the official version Manticore Core Team provides, you should execute the following commands in the directory containing the Manticore Search sources. This directory is the root of a cloned repository from https://github.com/manticoresoftware/manticoresearch:
docker run -it --rm -e SYSROOT_URL=https://repo.manticoresearch.com/repository/sysroots \
-e arch=x86_64 \
-e DISTR=rhel7 \
-e boost=boost_rhel_feb17 \
-e sysroot=roots_nov22 \
-v $(pwd):/manticore_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
manticoresearch/external_toolchain:clang16_cmake3263 bash
# following is to be run inside docker shell
cd /manticore_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/
mkdir build && cd build
cmake -DPACK=1 ..
cmake --build .
# or if you want to build packages:
# cmake --build . --target package
The long source directory path is required or it may fail to build the sources.
The same process can be used to build binaries/packages not only for popular Linux distributions, but also for FreeBSD, Windows, and macOS.
Compiling Manticore without using the building Docker is not recommended, but if you need to do it, here's what you may need to know:
xcode-select --install
to install).Manticore source code is hosted on GitHub.
To obtain the source code, clone the repository and then check out the desired branch or tag. The branch master
represents the main development branch. Upon release, a versioned tag is created, such as 3.6.0
and a new branch for the current release is started, in this case manticore-3.6.0
. The head of the versioned branch after all changes is used as source to build all binary releases. For example, to take sources of version 3.6.0 you can run:
git clone https://github.com/manticoresoftware/manticoresearch.git
cd manticoresearch
git checkout manticore-3.6.0
You can download the desired code from GitHub by using the "Download ZIP" button. Both .zip and .tar.gz formats are suitable.
wget -c https://github.com/manticoresoftware/manticoresearch/archive/refs/tags/3.6.0.tar.gz
tar -zxf 3.6.0.tar.gz
cd manticoresearch-3.6.0
Manticore uses CMake. Assuming you are inside the root directory of the cloned repository:
mkdir build && cd build
cmake ..
CMake will investigate available features and configure the build according to them. By default, all features are considered enabled if they are available. The script also downloads and builds some external libraries, assuming that you want to use them. Implicitly, you get support for the maximal number of features.
You can also configure the build explicitly with flags and options. To enable feature FOO
add -DFOO=1
to the CMake call.
To disable it, use -DFOO=0
. If not explicitly noted, enabling a feature that is not available((such as WITH_GALERA
on an MS Windows build)) will cause the configuration to fail with an error. Disabling a feature, apart from excluding it from the build, also disables its investigation on the system and disables the downloading/building of any related external libraries.
syslog
in query logging.RE2
library in your system.libstemmer
library in your system.icu_chinese
is in use.icu
library in your system. Also includes the ICU data file into the installation/distribution. The purpose of a statically linked ICU is to have a library of a known version, so that behavior is determined and not dependent on any system libraries. You will most likely prefer to use the system ICU instead, as it may be updated over time without the need to recompile the Manticore daemon. In this case, you need to explicitly disable this option. This will also save you some space occupied by the ICU data file (about 30M), as it will not be included in the distribution.MSSQL
also implies this flag.ODBC_LIB
with the proper path to an alternative library before running the indexer.indexer
tool even if you want to process something not related to xmlpipe. This option asks the indexer to load the library at runtime only when you want to deal with xmlpipe source.indexer
tool even if you want to process something not related to xmlpipe. This option asks the indexer to load the library at runtime only when you want to deal with xmlpipe source.ICONV_LIB
with the proper path to an alternative library before running the indexer.indexer
tool even if you want to process something not related to MySQL. This option asks the indexer to load the library at runtime only when you want to deal with a MySQL source.MYSQL_LIB
with the proper path to an alternative library before running the indexer.indexer
ool even if you want to process something not related to PostgreSQL. This option asks the indexer to load the library at runtime only when you want to deal with a PostgreSQL source.POSTGRESQL_LIB
with the proper path to an alternative library before running the indexer.manticore.conf
, which is not related to this build configuration), binlogs will be placed in this path. It is typically an absolute path, however, it is not required to be and relative paths can also be used. You probably would not need to change the default value defined by the configuration, which, depending on the target system, might be something like /var/data
, /var/lib/manticore/data
, or /usr/local/var/lib/manticore/data
.FULL_SHARE_DIR
before starting any tool that utilizes files from that folder. This is an important path as many things are expected to be found there by default. These include predefined charset tables, stopwords, manticore modules, and icu data files, all placed in that folder. The configuration script usually determines this path to be something like /usr/share/manticore
, or /usr/local/share/manticore
.DISTR
environment variable, assigns it to the DISTR_BUILD parameter, and then works as usual. This is very useful when building in prepared build systems, like Docker containers, where the DISTR
variable is set at the system level and reflects the target system for which the container is intended.cmake --install
command or create a package and then install it. The prefix can be changed at any time, even during installation, by invokingcmake --install . --prefix /path/to/installation
. However, at config time, this variable is used to initialize the default values of LOCALDATADIR
and FULL_SHARE_DIR
. For example, setting it to /my/custom
at configureLOCALDATADIR
as /my/custom/var/lib/manticore/data
, and FULL_SHARE_DIR
as/my/custom/usr/share/manticore
.libstemmer_c.tgz
) in this folder. Next time you want to build from scratch, the configuration script will first look up in the bundle, and if it finds the stemmer there, it will not download it again from the Internet.Note, that some options are organized in triples: WITH_XXX
, DL_XXX
and XXX_LIB
- like support of mysql, odbc, etc. WITH_XXX
determines whether next two have an effect or not. I.e., if you set WITH_ODBC
to 0
- there is no sence to provide DL_ODBC
and ODBC_LIB
, and these two will have no effect if the whole feature is disabled. Also, XXX_LIB
has no sense without DL_XXX
, because if you don't want DL_XXX
option, dynamic loading will not be used, and name provided by XXX_LIB
is useless. That is used by default introspection.
Also, using the iconv
library assumes expat
and is useless if the last is disabled.
Also, some libraries may be always available, and so, there is no sense to avoid linkage with them. For example, in Windows that is ODBC. On macOS that is Expat, iconv, and m.b. others. Default introspection determines such libraries and effectively emits only WITH_XXX
for them, without DL_XXX
and XXX_LIB
, that makes the things simpler.
With some options in game configuring might look like:
mkdir build && cd build
cmake -DWITH_MYSQL=1 -DWITH_RE2=1 ..
Apart general configuration values, you may also investigate file CMakeCache.txt
which is left in build folder right after you run configuration. Any values defined there might be redefined explicitly when running cmake. For example, you may run cmake -DHAVE_GETADDRINFO_A=FALSE ...
, and that config run will not assume investigated value of that variable, but will use one you've provided.
Environment variables are useful for providing some kind of global settings which are stored aside from build configuration and are always present. For persistence, they may be set globally on the system using different ways - like adding them to the .bashrc
file, or embedding them into a Dockerfile if you produce a docker-based build system, or writing them in system preferences environment variables on Windows. Also, you may set them short-lived using export VAR=value
in the shell. Or even shorter, by prepending values to the cmake call, like CACHEB=/my/cache cmake ...
- this way it will only work on this call and will not be visible on the next.
Some of such variables are known to be used in general by cmake and some other tools. That is things like CXX
which determines the current C++ compiler, or CXX_FLAGS
to provide compiler flags, etc.
However, we have some variables that are specific to manticore configuration, which are invented solely for our builds.
DISTR_BUILD
option when -DPACK=1
is used.WRITEB=1 cmake ...
- it will not find the stemmer's sources in the bundle and will then download them from the vendor's site to the bundle (without WRITEB it will download them into a temporary folder inside the build and will disappear when you wipe the build folder).At the end of configuration, you may see what is available and will be used in a list like this one:
-- Enabled features compiled in:
* Galera, replication of tables
* re2, a regular expression library
* stemmer, stemming library (Snowball)
* icu, International Components for Unicode
* OpenSSL, for encrypted networking
* ZLIB, for compressed data and networking
* ODBC, for indexing MSSQL (windows) and generic ODBC sources with indexer
* EXPAT, for indexing xmlpipe sources with indexer
* Iconv, for support of different encodings when indexing xmlpipe sources with indexer
* MySQL, for indexing MySQL sources with indexer
* PostgreSQL, for indexing PostgreSQL sources with indexer
cmake --build . --config RelWithDebInfo
To install run:
cmake --install . --config RelWithDebInfo
to install into custom (non-default) folder, run
cmake --install . --prefix path/to/build --config RelWithDebInfo
For building a package, use the target package
. It will build the package according to the selection provided by the -DDISTR_BUILD
option. By default, it will be a simple .zip or .tgz archive with all binaries and supplementary files.
cmake --build . --target package --config RelWithDebInfo
If you haven't changed the path for sources and build, simply move to your build folder and run:
cmake .
cmake --build . --clean-first --config RelWithDebInfo
If by any reason it doesn't work, you can delete file CMakeCache.txt
located in the build folder. After this step you
have to run cmake again, pointing to the source folder and configuring the options.
If it also doesn't help, just wipe out your build folder and begin from scratch.
Briefly - just use --config RelWithDebInfo
as written above. It will make no mistake.
We use two build types. For development, it is Debug
- it assigns compiler flags for optimization and other things in a way that it is very friendly for development, meaning the debug runs with step-by-step execution. However, the produced binaries are quite large and slow for production.
For releasing, we use another type - RelWithDebInfo
- which means 'release build with debug info'. It produces production binaries with embedded debug info. The latter is then split away into separate debuginfo packages which are stored aside with release packages and might be used in case of some issues like crashes - for investigation and bugfixing. Cmake also provides Release
and MinSizeRel
, but we don't use them. If the build type is not available, cmake will make a noconfig
build.
There are two types of generators: single-config and multi-config.
CMAKE_BUILD_TYPE
parameter. If it is not defined, the build will fall back to the RelWithDebInfo
type which is suitable if you just want to build Manticore from sources and not participate in development. For explicit builds, you should provide a build type, like -DCMAKE_BUILD_TYPE=Debug
.--config
option, otherwise it will build a kind of noconfig
, which is not desirable. So, you should always specify the build type, like --config Debug
.If you want to specify the build type but don't want to care about whether it is a 'single' or 'multi' config generator - just provide the necessary keys in both places. I.e., configure with -DCMAKE_BUILD_TYPE=Debug
, and then build with --config Debug
. Just be sure that both values are the same. If the target builder is a single-config, it will consume the configuration param. If it is multi-config, the configuration param will be ignored, but the correct build configuration will be selected by the --config
key.
If you want RelWithDebInfo
(i.e. just build for production) and know you're on a single-config platform (that is all, except Windows) - you can omit the --config
flag on the cmake invocation. The default CMAKE_BUILD_TYPE=RelWithDebInfo
will be configured then, and used. All the commands for 'building', 'installation' and 'building package' will become shorter then.
Cmake is the tool that doesn't perform building by itself, but it generates rules for the local build system.
Usually, it determines the available build system well, but sometimes you might need to provide a generator explicitly. You
can run cmake -G
and review the list of available generators.
cmake -G "Visual Studio 16 2019" ....
```
- On all other platforms - usually Unix Makefiles are used, but you can specify another one, such as Ninja, or Ninja Multi-Config, as:
Multi-Config`, as:
```bash
cmake -GNinja ...
```
or
```bash
cmake -G"Ninja Multi-Config" ...
Ninja Multi-Config is quite useful as it is really 'multi-config' and available on Linux/macOS/BSD. With this generator, you may shift the choosing of configuration type to build time, and also you may build several configurations in one and the same build folder, changing only the --config
param.
/manticore012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
, for example. That is because RPM tools modify the path over compiled binaries when building debug info, and it can just write over existing room and won't allocate more. The aforementioned long path has 100 chars and that is quite enough for such a case.Some libraries should be available if you want to use them.
- For indexing (indexer
tool): expat
, iconv
, mysql
, odbc
, postgresql
. Without them, you can only process tsv
and csv
sources.
- For serving queries (searchd
daemon): openssl
might be necessary.
- For all (required, mandatory!) we need the Boost library. The minimal version is 1.61.0, however, we build the binaries with a fresher version 1.75.0. Even more recent versions (like 1.76) should also be okay. On Windows, you can download pre-built Boost from their site (boost.org) and install it into the default suggested path (i.e. C:\\boost...
). On MacOs, the one provided in brew is okay. On Linux, you can check the available version in official repositories, and if it doesn't match requirements, you can build from sources. We need the component 'context', you can also build components 'system' and 'program_options', they will be necessary if you also want to build Galera library from the sources. Look into dist/build_dockers/xxx/boost_175/Dockerfile
for a short self-documented script/instruction on how to do it.
On the build system, you need the 'dev' or 'devel' versions of these packages installed (i.e. - libmysqlclient-devel, unixodbc-devel, etc. Look to our dockerfiles for the names of concrete packages).
On run systems, these packages should be present at least in the final (non-dev) variants. (devel variants usually larger, as they include not only target binaries, but also different development stuff like include headers, etc.).
Apart from necessary prerequisites, you might need prebuilt expat
, iconv
, mysql
, and postgresql
client libraries. You have to either build them yourself or contact us to get our build bundle (a simple zip archive where the folder with these targets is located).
Run indexer -h
. It will show which features were configured and built (whether they're explicit or investigated, doesn't matter):
Built on Linux x86_64 by GNU 8.3.1 compiler.
Configured with these definitions: -DDISTR_BUILD=rhel8 -DUSE_SYSLOG=1 -DWITH_GALERA=1 -DWITH_RE2=1 -DWITH_RE2_FORCE_STATIC=1
-DWITH_STEMMER=1 -DWITH_STEMMER_FORCE_STATIC=1 -DWITH_ICU=1 -DWITH_ICU_FORCE_STATIC=1 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ODBC=1 -DDL_ODBC=1
-DODBC_LIB=libodbc.so.2 -DWITH_EXPAT=1 -DDL_EXPAT=1 -DEXPAT_LIB=libexpat.so.1 -DWITH_ICONV=1 -DWITH_MYSQL=1 -DDL_MYSQL=1
-DMYSQL_LIB=libmariadb.so.3 -DWITH_POSTGRESQL=1 -DDL_POSTGRESQL=1 -DPOSTGRESQL_LIB=libpq.so.5 -DLOCALDATADIR=/var/lib/manticore/data
-DFULL_SHARE_DIR=/usr/share/manticore
Manticore Search 2.x maintains compatibility with Sphinxsearch 2.x and can load existing tables created by Sphinxsearch. In most cases, upgrading is just a matter of replacing the binaries.
Instead of sphinx.conf (in Linux normally located at /etc/sphinxsearch/sphinx.conf
) Manticore by default uses /etc/manticoresearch/manticore.conf
. It also runs under a different user and use different folders.
Systemd service name has changed from sphinx/sphinxsearch
to manticore
and the service runs under user manticore
(Sphinx was using sphinx
or sphinxsearch
). It also uses a different folder for the PID file.
The folders used by default are /var/lib/manticore
, /var/log/manticore
, /var/run/manticore
. You can still use the existing Sphinx config, but you need to manually change permissions for /var/lib/sphinxsearch
and /var/log/sphinxsearch
folders. Or, just rename globally 'sphinx' to 'manticore' in system files. If you use other folders (for data, wordforms files etc.) the ownership must be also switched to user manticore
. The pid_file
location should be changed to match the manticore.service to /var/run/manticore/searchd.pid
.
If you want to use the Manticore folder instead, the table files need to be moved to the new data folder (/var/lib/manticore
) and the permissions must be changed to user manticore
.
Upgrading from Sphinx / Manticore 2.x to 3.x is not straightforward, as the table storage engine has undergone a significant upgrade and the new searchd cannot load older tables and upgrade them to the new format on-the-fly.
Manticore Search 3 got a redesigned table storage. Tables created with Manticore/Sphinx 2.x cannot be loaded by Manticore Search 3 without a conversion. Because of the 4GB limitation, a real-time table in 2.x could still have several disk chunks after an optimize operation. After upgrading to 3.x, these tables can now be optimized to 1-disk chunk with the usual OPTIMIZE command. Index files also changed. The only component that didn't get any structural changes is the .spp
file (hitlists). .sps
(strings/json) and .spm
(MVA) are now held by .spb
(var-length attributes). The new format has an .spm
file present, but it's used for row map (previously it was dedicated for MVA attributes). The new extensions added are .spt
(docid lookup), .sphi
( secondary index histograms), .spds
(document storage). In case you are using scripts that manipulate table files, they should be adapted for the new file extensions.
The upgrade procedure may differ depending on your setup (number of servers in the cluster, whether you have high availability or not, etc.), but in general, it involves creating new 3.x table versions and replacing your existing ones, as well as replacing older 2.x binaries with the new ones.
There are two special requirements to take care:
Manticore Search 3 includes a new tool - index_converter - that can convert Sphinx 2.x / Manticore 2.x tables to 3.x format. index_converter
comes in a separate package which should be installed first. Using the convert tool create 3.x versions of your tables. index_converter
can write the new files in the existing data folder and backup the old files or it can write the new files to a chosen folder.
If you have a single server:
--output-dir
option)To minimize downtime, you can copy 2.x tables, config (you'll need to edit paths here for tables, logs, and different ports), and binaries to a separate location and start this on a separate port. Point your application to it. After upgrading to 3.0 and the new server is started, you can point the application back to the normal ports. If everything is good, stop the 2.x copy and delete the files to free up space.
If you have a spare box (like a testing or staging server), you can do the table upgrade there first and even install Manticore 3 to perform several tests. If everything is okay, copy the new table files to the production server. If you have multiple servers that can be pulled out of production, do it one by one and perform the upgrade on each. For distributed setups, 2.x searchd can work as a master with 3.x nodes, so you can do the upgrading on the data nodes first, and then on the master node.
There have been no changes made to the way clients should connect to the engine, or any changes to the querying mode or behavior of queries.
Kill-lists have been redesigned in Manticore Search 3. In previous versions, kill-lists were applied to the result set provided by each previously searched table at query time.
Thus, in 2.x, the table order at query time mattered. For example, if a delta table had a kill-list, in order to apply it against the main table, the order had to be main, delta (either in a distributed table or in the FROM clause).
In Manticore 3, kill-lists are applied to a table when it's loaded during searchd startup or gets rotated. The new directive killlist_target
in table configuration specifies target tables and defines which doc ids from the source table should be used for suppression. These can be ids from the defined kill-list, actual doc ids of the table or both.
Documents from the kill-lists are deleted from the target tables, they are not returned in results even if the search doesn't include the table that provided the kill-lists. Because of that, the order of tables for searching does not matter anymore. Now, delta, main
and main, delta
will provide the same results.
In previous versions, tables were rotated following the order from the configuration file. In Manticore 3 table rotation order is much smarter and works in accordance with killlist targets. Before starting to rotate tables, the server looks for chains of tables by killlist_target
definitions. It will then first rotate tables not referenced anywhere as kill-lists targets. Next, it will rotate tables targeted by already rotated tables and so on. For example, if we do indexer --all
and we have 3 tables: main, delta_big (which targets at the main) and delta_small (with target at delta_big), first, delta_small is rotated, then delta_big and finally the main. This is to ensure that when a dependent table is rotated it gets the most actual kill-list from other tables.
docinfo
- everything is now externinplace_docinfo_gap
- not needed anymoremva_updates_pool
- MVAs don’t have anymore a dedicated pool for updates, as now they can be updated directly in the blob (see below).String, JSON and MVA attributes can be updated in Manticore 3.x using UPDATE
statement.
In 2.x string attributes required REPLACE
, for JSON it was only possible to update scalar properties (as they were fixed-width) and MVAs could be updated using the MVA pool. Now updates are performed directly on the blob component. One setting that may require tuning is attr_update_reserve which allows changing the allocated extra space at the end of the blob used to avoid frequent resizes in case the new values are bigger than the existing values in the blob.
Doc ids used to be UNSIGNED 64-bit integers. Now they are POSITIVE SIGNED 64-bit integers.
Read here about the RT mode
Manticore 3.x recognizes and parses special suffixes which makes easier to use numeric values with special meaning. Common form for them is integer number + literal, like 10k or 100d, but not 40.3s (since 40.3 is not integer), or not 2d 4h (since there are two, not one value). Literals are case-insensitive, so 10W is the same as 10w. There are 2 types of such suffixes currently supported:
k
for kilobytes (1k=1024), m
for megabytes (1m=1024k), g
for gigabytes (1g=1024m) and t
for terabytes (1t=1024g).us
for useconds (microseconds), ms
for milliseconds, s
for seconds, m
for minutes, h
for hours, d
for days and w
for weeks.index_converter
is a tool for converting tables created with Sphinx/Manticore Search 2.x to the Manticore Search 3.x table format. The tool can be used in several different ways:
$ index_converter --config /home/myuser/manticore.conf --index tablename
$ index_converter --config /home/myuser/manticore.conf --all
$ index_converter --path /var/lib/manticoresearch/data --all
The new version of the table is written by default in the same folder. The previous version's files are saved with the .old
extension in their name. An exception is the .spp
(hitlists) file, which is the only table component that didn't have any changes in the new format.
You can save the new table version to a different folder using the -–output-dir
option
$ index_converter --config /home/myuser/manticore.conf --all --output-dir /new/path
A special case is for tables containing kill-lists. As the behaviour of how kill-lists works has changed (see killlist_target), the delta table should know which are the target tables for applying the kill-lists. There are 3 ways to have a converted table ready for setting targeted tables for applying kill-lists:
Use -–killlist-target
when converting a table
ini
$ index_converter --config /home/myuser/manticore.conf --index deltaindex --killlist-target mainindex:kl
Add killlist_target in the configuration before doing the conversion
Here's the complete list of index_converter
options:
--config <file>
(-c <file>
for short) tells index_converter to use the given file as its configuration. Normally, it will look for manticore.conf in the installation directory (e.g. /usr/local/manticore/etc/manticore.conf
if installed into /usr/local/sphinx
), followed by the current directory you are in when calling index_converter from the shell.--index
specifies which table should be converted--path
- instead of using a config file, a path containing table(s) can be used--strip-path
- strips path from filenames referenced by table: stopwords, exceptions and wordforms--large-docid
- allows to convert documents with ids larger than 2^63 and display a warning, otherwise it will just exit on the large id with an error. This option was added as in Manticore 3.x doc ids are signed bigint, while previously they were unsigned--output-dir <dir>
- writes the new files in a chosen folder rather than the same location as with the existing table files. When this option set, existing table files will remain untouched at their location.--all
- converts all tables from the config--killlist-target <targets>
sets the target tables for which kill-lists will be applied. This option should be used only in conjunction with the --index
option