Quick start guide

Install and start Manticore

You can install and start Manticore easily on various operating systems, including Ubuntu, Centos, Debian, Windows, and MacOS. Additionally, you can also 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

Connect to 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

More details about HTTPS support can be found in our learning course here.

‹›
  • SQL
  • HTTP
  • PHP
  • Python
  • Javascript
  • Java
  • C#
  • Typescript
  • Go
📋
mysql -h0 -P9306

Create a table

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.

More information about different ways to create a table can be found in our learning courses:

‹›
  • SQL
  • HTTP
  • PHP
  • Python
  • Javascript
  • Java
  • C#
  • TypeScript
  • Go
📋
create table products(title text, price float) morphology='stem_en';
‹›
Response
Query OK, 0 rows affected (0.02 sec)

Add documents

Let's now add few documents to the table:

‹›
  • SQL
  • JSON
  • PHP
  • Python
  • Javascript
  • Java
  • C#
  • TypeScript
  • Go
📋
insert into products(title,price) values ('Crossbody Bag with Tassel', 19.85), ('microfiber sheet set', 19.99), ('Pet Hair Remover Glove', 7.99);
‹›
Response
Query OK, 3 rows affected (0.01 sec)

More details on the subject can be found here:

Search

Let's find one of the documents. The query we will use is 'remove hair'. As you can see, it finds a document with the 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
  • C#
  • TypeScript
  • Go
📋
select id, highlight(), price from products where match('remove hair');
‹›
Response
+---------------------+-------------------------------+----------+
| id                  | highlight()                   | price    |
+---------------------+-------------------------------+----------+
| 1513686608316989452 | Pet <strong>Hair Remover</strong> Glove | 7.990000 |
+---------------------+-------------------------------+----------+
1 row in set (0.00 sec)

More information on different search options available in Manticore can be found in our learning courses:

Update

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
  • C#
  • TypeScript
  • Go
📋
update products set price=18.5 where id = 1513686608316989452;
‹›
Response
Query OK, 1 row affected (0.00 sec)

Delete

Let's now delete all documents with price lower than 10.

‹›
  • SQL
  • JSON
  • PHP
  • Python
  • javascript
  • Java
  • C#
  • TypeScript
  • Go
📋
delete from products where price < 10;
‹›
Response
Query OK, 1 row affected (0.00 sec)