Skip to content

Install Manticore Search

Install Manticore Search on Ubuntu via APT, define a real-time index in SQL syntax, and query it with MySQL protocol or HTTP/JSON. Sphinx fork explained.

Manticore Search is the actively-maintained Sphinx fork — a full-text search engine that exposes both MySQL and HTTP/JSON protocols, with real-time indices, percolate queries, and a SQL-like configuration. This article installs Manticore on Ubuntu via the vendor APT repo, defines a real-time index, and queries it from mysql and curl. Audience is operators who want SQL ergonomics with search performance and a small operational footprint.

How to verify

After install, confirm the daemon is listening on both protocols:

systemctl status manticore
journalctl -u manticore -n 50 --no-pager
ss -tlnp | grep -E '9306|9308'
mysql -h 127.0.0.1 -P 9306 -e 'SHOW STATUS'
curl -s http://127.0.0.1:9308/cli -d 'SHOW STATUS'
curl -s http://127.0.0.1:9308/cli -d 'SHOW TABLES'

Manticore listens on 9306 (MySQL wire protocol — yes, you can use mysql CLI directly), 9308 (HTTP/JSON), and 9312 (legacy SphinxAPI). All three speak to the same engine.

What’s happening

Manticore forked from Sphinx in 2017 and is the canonical successor — modern packaging, regular releases, and active development. It’s a search engine with a SQL flavor: tables (formerly “indices”) are declared with column types (text, string, integer, float, bigint, bool, multi, json), and you INSERT/SELECT/UPDATE documents using familiar syntax.

Two table types matter operationally:

  • Plaintext tables — built offline from a source (CSV, MySQL, PostgreSQL), rebuilt via indexer. Fast for static catalogs.
  • Real-time (RT) tables — modified in place via INSERT/REPLACE/DELETE. Use these for application-coupled data.

The wire-protocol compatibility with MySQL means existing tools (DataGrip, MySQL Workbench, language MySQL drivers) work as-is for ad-hoc queries.

The procedure

1. Add the vendor APT repo and install:

curl -fsSL https://repo.manticoresearch.com/manticore-repo.noarch.deb -o /tmp/manticore-repo.deb
sudo dpkg -i /tmp/manticore-repo.deb
sudo apt update
sudo apt install -y manticore manticore-extra

2. Edit the config at /etc/manticoresearch/manticore.conf to keep it minimal:

searchd {
    listen = 127.0.0.1:9306:mysql
    listen = 127.0.0.1:9308:http
    log = /var/log/manticore/searchd.log
    query_log = /var/log/manticore/query.log
    pid_file = /var/run/manticore/searchd.pid
    data_dir = /var/lib/manticore
    binlog_path = /var/lib/manticore/binlog
}

Restart and verify:

sudo systemctl restart manticore
mysql -h 127.0.0.1 -P 9306 -e 'SHOW VARIABLES'

3. Create a real-time table via the MySQL protocol:

mysql -h 127.0.0.1 -P 9306 <<SQL
CREATE TABLE products (
  title text,
  brand string attribute,
  price float,
  in_stock bool
) min_infix_len='2' index_exact_words='1';
SQL

text columns are tokenized and searchable; string and float are filterable/sortable attributes. min_infix_len='2' enables substring matching from two characters.

4. Insert and query:

mysql -h 127.0.0.1 -P 9306 <<SQL
INSERT INTO products (id, title, brand, price, in_stock) VALUES
  (1, 'Linen shirt Apex regular fit', 'Apex',  59.0, 1),
  (2, 'Cotton tee Apex slim cut',     'Apex',  29.0, 1),
  (3, 'Wool sweater Vega heavy',      'Vega', 129.0, 0);

SELECT id, title, WEIGHT() AS w
  FROM products
  WHERE MATCH('linen apex')
  ORDER BY w DESC, price ASC;
SQL

WEIGHT() is the BM25 score; MATCH() is the full-text predicate.

5. Same query over HTTP/JSON:

curl -s -X POST http://127.0.0.1:9308/search \
  -H 'Content-Type: application/json' \
  -d '{
    "index": "products",
    "query": {
      "match": {"title": "linen apex"}
    },
    "_source": ["title", "price"]
  }' | jq

6. Real-time updates without rebuild:

mysql -h 127.0.0.1 -P 9306 -e \
  "REPLACE INTO products (id, title, brand, price, in_stock) VALUES (3, 'Wool sweater Vega heavy', 'Vega', 119.0, 1)"
mysql -h 127.0.0.1 -P 9306 -e \
  "DELETE FROM products WHERE id=2"

Changes are visible immediately and persisted via the binlog.

Operational notes

  • OPTIMIZE TABLE matters. Real-time tables accumulate RAM chunks and disk chunks; OPTIMIZE TABLE products merges them. Schedule nightly or after heavy import.
  • Binlog grows. Set binlog_max_log_size in searchd (e.g. 268435456 for 256 MB) and rotate periodically. FLUSH RAMCHUNK plus restart trims it.
  • Wire-protocol MySQL ≠ MySQL. You cannot run arbitrary MySQL DDL — only what Manticore implements. CREATE INDEX, foreign keys, joins across tables don’t behave like MySQL.
  • Replication is built-in. Use Galera-based clustering (Manticore embeds the Galera library) — CREATE CLUSTER followed by JOIN CLUSTER on peers. Bring up cleanly on a fresh data dir.
  • Backups are file copies of /var/lib/manticore. Stop the daemon or use BACKUP TO '/path' (Pro feature). For Community, FLUSH RAMCHUNK then rsync.

In the engagements we run, Manticore is a strong fit when the application is already MySQL-shaped and the team wants search without operating a JVM cluster. The MySQL wire protocol means the database tools the team already knows work directly, and the operational footprint is small. For document analytics or log analytics we still reach for Elasticsearch or OpenSearch. See /en/services/managed-operations/ for how we run search engines alongside SQL-shaped applications.