You can install and start Manticore easily in Ubuntu, Centos, Debian, Windows and MacOS or use Manticore as a docker container.
- Ubuntu
- Debian
- Centos
- Windows
- MacOS
- Docker
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
sudo apt install manticore manticore-columnar-lib
sudo systemctl start manticore
By default Manticore is waiting for your connections on:
- port 9306 for MySQL clients
- port 9308 for HTTP/HTTPS connections
- port 9312 for connections from other Manticore nodes and clients based on Manticore binary API
- SQL
- HTTP
- PHP
- Python
- Javascript
- Java
mysql -h0 -P9306
Let's now create a table called "products" with 2 fields:
- title - full-text field which will contain our product's title
- price - of type "float"
Note that it is possible to omit creating a table with an explicit create statement. For more information, see Auto schema.
- SQL
- HTTP
- PHP
- Python
- Javascript
- Java
create table products(title text, price float) morphology='stem_en';
Query OK, 0 rows affected (0.02 sec)
- SQL
- JSON
- PHP
- Python
- Javascript
- Java
insert into products(title,price) values ('Crossbody Bag with Tassel', 19.85), ('microfiber sheet set', 19.99), ('Pet Hair Remover Glove', 7.99);
Query OK, 3 rows affected (0.01 sec)
Let's find one of the documents. The query we will use is 'remove hair'. As you can see it finds document with title 'Pet Hair Remover Glove' and highlights 'Hair remover' in it even though the query has "remove", not "remover". This is because when we created the table we turned on using English stemming (morphology "stem_en"
).
- SQL
- JSON
- PHP
- Python
- javascript
- Java
select id, highlight(), price from products where match('remove hair');
+---------------------+-------------------------------+----------+
| id | highlight() | price |
+---------------------+-------------------------------+----------+
| 1513686608316989452 | Pet <strong>Hair Remover</strong> Glove | 7.990000 |
+---------------------+-------------------------------+----------+
1 row in set (0.00 sec)
Let's assume we now want to update the document - change the price to 18.5. This can be done by filtering by any field, but normally you know the document id and update something based on that.
- SQL
- JSON
- PHP
- Python
- javascript
- Java
update products set price=18.5 where id = 1513686608316989452;
Query OK, 1 row affected (0.00 sec)
When Manticore Search is installed using DEB or RPM packages, the searchd process can be run and managed by operating system's init system. Most Linux versions now use systemd, while older releases use SysV init.
If you are not sure about the type of the init system your platform use, run:
ps --no-headers -o comm 1
After the installation the Manticore Search service is not started automatically. To start Manticore run the following command:
sudo systemctl start manticore
To stop Manticore run the following command:
sudo systemctl stop manticore
The Manticore service is set to run at boot. You can check it by running:
sudo systemctl is-enabled manticore
If you want to disable Manticore starting at boot time run:
sudo systemctl disable manticore
To make Manticore start at boot, run:
sudo systemctl enable manticore
In some newer operating systems it can fail with error "Failed to enable unit: Unit ... is transient or generated.". In this case you can remove the generator and try again. It's unlikely you need the generator ever again after Manticore is installed.
In Debian-based operating systems run:
sudo rm /lib/systemd/system-generators/manticore-generator
sudo systemctl daemon-reload
In CentOS and RHEL run:
sudo rm /usr/lib/systemd/system-generators/manticore-search-generator
sudo systemctl daemon-reload
If you still need the generator again just install the Manticore packages again and it will recover the generator file.
searchd
process logs startup information in systemd
journal. If systemd
logging is enabled you can view the logged information with the following command:
sudo journalctl --unit manticore
systemctl set-environment _ADDITIONAL_SEARCHD_PARAMS
allows you to specify custom startup flags Manticore Search daemon should be started with. See full list here.
For example, to start Manticore with debug logging level you can run:
systemctl set-environment _ADDITIONAL_SEARCHD_PARAMS='--logdebug'
systemctl restart manticore
To undo it run:
systemctl set-environment _ADDITIONAL_SEARCHD_PARAMS=''
systemctl restart manticore
Note, systemd environment variables get reset on server reboot.
Manticore can be started and stopped using service commands:
sudo service manticore start
sudo service manticore stop
To enable the sysV service at boot on RedHat systems run:
chkconfig manticore on
To enable the sysV service at boot on Debian systems (including Ubuntu) run:
update-rc.d manticore defaults
Please note that searchd
is started by the init system under manticore
user and all files created by the server will be owned by this user. If searchd
is started under ,for example, root user, the permissions of files will be changed which may lead to issues when running again searchd
as service.