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
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
sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
sudo yum install manticore manticore-columnar-lib
sudo systemctl start manticore
- Download the Windows archive from https://manticoresearch.com/install/
- Extract all files from the archive to
C:\Manticore
- Run the following command to install Manticore as a service:
-
C:\Manticore\bin\searchd --install --config C:\Manticore\sphinx.conf.in --servicename Manticore
- Start Manticore from the Services snap-in of the Microsoft Management Console.
brew install manticoresearch
brew services start manticoresearch
docker pull manticoresearch/manticore
docker run --name manticore -p9306:9306 -p9308:9308 -p9312:9312 -d manticoresearch/manticore
For persisting your data directory, read how to use Manticore docker in production
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
HTTP is a stateless protocol, so it doesn't require any special connection phase. You can simply send an HTTP request to the server and receive the response. To communicate with Manticore using the JSON interface, you can use any HTTP client library in your programming language of choice to send GET or POST requests to the server and parse the JSON responses:
curl -s "http://localhost:9308/search"
// https://github.com/manticoresoftware/manticoresearch-php
require_once __DIR__ . '/vendor/autoload.php';
$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
// https://github.com/manticoresoftware/manticoresearch-python
import manticoresearch
config = manticoresearch.Configuration(
host = "http://127.0.0.1:9308"
)
client = manticoresearch.ApiClient(config)
indexApi = manticoresearch.IndexApi(client)
searchApi = manticoresearch.SearchApi(client)
utilsApi = manticoresearch.UtilsApi(client)
// https://github.com/manticoresoftware/manticoresearch-javascript
var Manticoresearch = require('manticoresearch');
var client= new Manticoresearch.ApiClient()
client.basePath="http://127.0.0.1:9308";
indexApi = new Manticoresearch.IndexApi(client);
searchApi = new Manticoresearch.SearchApi(client);
utilsApi = new Manticoresearch.UtilsApi(client);
// https://github.com/manticoresoftware/manticoresearch-java
import com.manticoresearch.client.*;
import com.manticoresearch.client.model.*;
import com.manticoresearch.client.api.*;
...
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("http://127.0.0.1:9308");
...
IndexApi indexApi = new IndexApi(client);
SearchApi searchApi = new UtilsApi(client);
UtilsApi utilsApi = new UtilsApi(client);
// https://github.com/manticoresoftware/manticoresearch-net
using System.Net.Http;
...
using ManticoreSearch.Client;
using ManticoreSearch.Api;
using ManticoreSearch.Model;
...
config = new Configuration();
config.BasePath = "http://localhost:9308";
httpClient = new HttpClient();
httpClientHandler = new HttpClientHandler();
...
var indexApi = new IndexApi(httpClient, config, httpClientHandler);
var searchApi = new SearchApi(httpClient, config, httpClientHandler);
var utilsApi = new UtilsApi(httpClient, config, httpClientHandler);
import {
Configuration,
IndexApi,
SearchApi,
UtilsApi
} from "manticoresearch-ts";
...
const config = new Configuration({
basePath: 'http://localhost:9308',
})
const indexApi = new IndexApi(config);
const searchApi = new SearchApi(config);
const utilsApi = new UtilsApi(config);
import (
"context"
manticoreclient "github.com/manticoresoftware/manticoresearch-go"
)
...
configuration := manticoreclient.NewConfiguration()
configuration.Servers[0].URL = "http://localhost:9308"
apiClient := manticoreclient.NewAPIClient(configuration)
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';
POST /cli -d "create table products(title text, price float) morphology='stem_en'"
$index = new \Manticoresearch\Index($client);
$index->setName('products');
$index->create([
'title'=>['type'=>'text'],
'price'=>['type'=>'float'],
],['morphology' => 'stem_en']);
utilsApi.sql('create table products(title text, price float) morphology=\'stem_en\'')
res = await utilsApi.sql('create table products(title text, price float) morphology=\'stem_en\'');
utilsApi.sql("create table products(title text, price float) morphology='stem_en'");
utilsApi.Sql("create table products(title text, price float) morphology='stem_en'");
res = await utilsApi.sql('create table products(title text, price float) morphology=\'stem_en\'');
res := apiClient.UtilsAPI.Sql(context.Background()).Body("create table products(title text, price float) morphology='stem_en'").Execute();
Query OK, 0 rows affected (0.02 sec)
{
"total":0,
"error":"",
"warning":""
}
- 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);
"id":0
or no id forces automatic ID generation.
POST /insert
{
"table":"products",
"doc":
{
"title" : "Crossbody Bag with Tassel",
"price" : 19.85
}
}
POST /insert
{
"table":"products",
"doc":
{
"title" : "microfiber sheet set",
"price" : 19.99
}
}
POST /insert
{
"table":"products",
"doc":
{
"title" : "Pet Hair Remover Glove",
"price" : 7.99
}
}
$index->addDocuments([
['title' => 'Crossbody Bag with Tassel', 'price' => 19.85],
['title' => 'microfiber sheet set', 'price' => 19.99],
['title' => 'Pet Hair Remover Glove', 'price' => 7.99]
]);
indexApi.insert({"table" : "products", "doc" : {"title" : "Crossbody Bag with Tassel", "price" : 19.85}})
indexApi.insert({"table" : "products", "doc" : {"title" : "microfiber sheet set", "price" : 19.99}})
indexApi.insert({"table" : "products", "doc" : {"title" : "Pet Hair Remover Glove", "price" : 7.99}})
res = await indexApi.insert({"table" : "products", "doc" : {"title" : "Crossbody Bag with Tassel", "price" : 19.85}});
res = await indexApi.insert({"table" : "products", "doc" : {"title" : "microfiber sheet set", "price" : 19.99}});
res = await indexApi.insert({"table" : "products", "doc" : {"title" : "Pet Hair Remover Glove", "price" : 7.99}});
InsertDocumentRequest newdoc = new InsertDocumentRequest();
HashMap<String,Object> doc = new HashMap<String,Object>(){{
put("title","Crossbody Bag with Tassel");
put("price",19.85);
}};
newdoc.index("products").setDoc(doc);
sqlresult = indexApi.insert(newdoc);
newdoc = new InsertDocumentRequest();
doc = new HashMap<String,Object>(){{
put("title","microfiber sheet set");
put("price",19.99);
}};
newdoc.index("products").setDoc(doc);
sqlresult = indexApi.insert(newdoc);
newdoc = new InsertDocumentRequest();
doc = new HashMap<String,Object>(){{
put("title","Pet Hair Remover Glove");
put("price",7.99);
}};
newdoc.index("products").setDoc(doc);
indexApi.insert(newdoc);
Dictionary<string, Object> doc = new Dictionary<string, Object>();
doc.Add("title","Crossbody Bag with Tassel");
doc.Add("price",19.85);
InsertDocumentRequest insertDocumentRequest = new InsertDocumentRequest(index: "products", doc: doc);
sqlresult = indexApi.Insert(insertDocumentRequest);
doc = new Dictionary<string, Object>();
doc.Add("title","microfiber sheet set");
doc.Add("price",19.99);
insertDocumentRequest = new InsertDocumentRequest(index: "products", doc: doc);
sqlresult = indexApi.Insert(insertDocumentRequest);
doc = new Dictionary<string, Object>();
doc.Add("title","Pet Hair Remover Glove");
doc.Add("price",7.99);
insertDocumentRequest = new InsertDocumentRequest(index: "products", doc: doc);
sqlresult = indexApi.Insert(insertDocumentRequest);
res = await indexApi.insert({
index: 'test',
id: 1,
doc: { content: 'Text 1', name: 'Doc 1', cat: 1 },
});
res = await indexApi.insert({
index: 'test',
id: 2,
doc: { content: 'Text 2', name: 'Doc 2', cat: 2 },
});
res = await indexApi.insert({
index: 'test',
id: 3,
doc: { content: 'Text 3', name: 'Doc 3', cat: 7 },
});
indexDoc := map[string]interface{} {"content": "Text 1", "name": "Doc 1", "cat": 1 }
indexReq := manticoreclient.NewInsertDocumentRequest("products", indexDoc)
indexReq.SetId(1)
apiClient.IndexAPI.Insert(context.Background()).InsertDocumentRequest(*indexReq).Execute()
indexDoc = map[string]interface{} {"content": "Text 2", "name": "Doc 3", "cat": 2 }
indexReq = manticoreclient.NewInsertDocumentRequest("products", indexDoc)
indexReq.SetId(2)
apiClient.IndexAPI.Insert(context.Background()).InsertDocumentRequest(*indexReq).Execute()
indexDoc = map[string]interface{} {"content": "Text 3", "name": "Doc 3", "cat": 7 }
indexReq = manticoreclient.NewInsertDocumentRequest("products", indexDoc)
indexReq.SetId(3)
apiClient.IndexAPI.Insert(context.Background()).InsertDocumentRequest(*indexReq).Execute()
Query OK, 3 rows affected (0.01 sec)
{
"table": "products",
"_id": 0,
"created": true,
"result": "created",
"status": 201
}
{
"table": "products",
"_id": 0,
"created": true,
"result": "created",
"status": 201
}
{
"table": "products",
"_id": 0,
"created": true,
"result": "created",
"status": 201
}
More details on the subject can be found here:
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');
POST /search
{
"table": "products",
"query": { "match": { "title": "remove hair" } },
"highlight":
{
"fields": ["title"]
}
}
$result = $index->search('@title remove hair')->highlight(['title'])->get();
foreach($result as $doc)
{
echo "Doc ID: ".$doc->getId()."\n";
echo "Doc Score: ".$doc->getScore()."\n";
echo "Document fields:\n";
print_r($doc->getData());
echo "Highlights: \n";
print_r($doc->getHighlight());
}
searchApi.search({"table":"products","query":{"query_string":"@title remove hair"},"highlight":{"fields":["title"]}})
res = await searchApi.search({"table":"products","query":{"query_string":"@title remove hair"}"highlight":{"fields":["title"]}});
query = new HashMap<String,Object>();
query.put("query_string","@title remove hair");
searchRequest = new SearchRequest();
searchRequest.setIndex("forum");
searchRequest.setQuery(query);
HashMap<String,Object> highlight = new HashMap<String,Object>(){{
put("fields",new String[] {"title"});
}};
searchRequest.setHighlight(highlight);
searchResponse = searchApi.search(searchRequest);
object query = new { query_string="@title remove hair" };
var searchRequest = new SearchRequest("products", query);
var highlight = new Highlight();
highlight.Fieldnames = new List<string> {"title"};
searchRequest.Highlight = highlight;
searchResponse = searchApi.Search(searchRequest);
res = await searchApi.search({
index: 'test',
query: { query_string: {'text 1'} },
highlight: {'fields': ['content'] }
});
searchRequest := manticoreclient.NewSearchRequest("test")
query := map[string]interface{} {"query_string": "text 1"};
searchRequest.SetQuery(query);
highlightField := manticoreclient.NewHighlightField("content")
fields := []interface{}{ highlightField }
highlight := manticoreclient.NewHighlight()
highlight.SetFields(fields)
searchRequest.SetHighlight(highlight);
res, _, _ := apiClient.SearchAPI.Search(context.Background()).SearchRequest(*searchRequest).Execute()
+---------------------+-------------------------------+----------+
| id | highlight() | price |
+---------------------+-------------------------------+----------+
| 1513686608316989452 | Pet <strong>Hair Remover</strong> Glove | 7.990000 |
+---------------------+-------------------------------+----------+
1 row in set (0.00 sec)
{
"took": 0,
"timed_out": false,
"hits": {
"total": 1,
"hits": [
{
"_id": 1513686608316989452,
"_score": 1680,
"_source": {
"price": 7.99,
"title": "Pet Hair Remover Glove"
},
"highlight": {
"title": [
"Pet <strong>Hair Remover</strong> Glove"
]
}
}
]
}
}
Doc ID: 1513686608316989452
Doc Score: 1680
Document fields:
Array
(
[price] => 7.99
[title] => Pet Hair Remover Glove
)
Highlights:
Array
(
[title] => Array
(
[0] => Pet <strong>Hair Remover</strong> Glove
)
)
`
{'hits': {'hits': [{u'_id': u'1513686608316989452',
u'_score': 1680,
u'_source': {u'title': u'Pet Hair Remover Glove', u'price':7.99},
u'highlight':{u'title':[u'Pet <strong>Hair Remover</strong> Glove']}}}],
'total': 1},
'profile': None,
'timed_out': False,
'took': 0}
{"hits": {"hits": [{"_id": 1513686608316989452,
"_score": 1680,
"_source": {"title": "Pet Hair Remover Glove", "price":7.99},
"highlight":{"title":["Pet <strong>Hair Remover</strong> Glove"]}}],
"total": 1},
"profile": None,
"timed_out": False,
"took": 0}
class SearchResponse {
took: 84
timedOut: false
hits: class SearchResponseHits {
total: 1
maxScore: null
hits: [{_id=1513686608316989452, _score=1, _source={price=7.99, title=Pet Hair Remover Glove}, highlight={title=[Pet <strong>Hair Remover</strong> Glove]}}]
aggregations: null
}
profile: null
}
class SearchResponse {
took: 103
timedOut: false
hits: class SearchResponseHits {
total: 1
maxScore: null
hits: [{_id=1513686608316989452, _score=1, _source={price=7.99, title=Pet Hair Remover Glove}, highlight={title=[Pet <strong>Hair Remover</strong> Glove]}}]
aggregations: null
}
profile: null
}
{
"hits":
{
"hits":
[{
"_id": 1,
"_score": 1400,
"_source": {"content":"Text 1","name":"Doc 1","cat":1},
"highlight": {"content":["<strong>Text 1</strong>"]}
}],
"total": 1
},
"profile": None,
"timed_out": False,
"took": 0
}
{
"hits":
{
"hits":
[{
"_id": 1,
"_score": 1400,
"_source": {"content":"Text 1","name":"Doc 1","cat":1},
"highlight": {"content":["<strong>Text 1</strong>"]}
}],
"total": 1
},
"profile": None,
"timed_out": False,
"took": 0
}
More information on different search options available in Manticore can be found in our learning courses:
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;
POST /update
{
"table": "products",
"id": 1513686608316989452,
"doc":
{
"price": 18.5
}
}
$doc = [
'body' => [
'table' => 'products',
'id' => 2,
'doc' => [
'price' => 18.5
]
]
];
$response = $client->update($doc);
indexApi = api = manticoresearch.IndexApi(client)
indexApi.update({"table" : "products", "id" : 1513686608316989452, "doc" : {"price":18.5}})
res = await indexApi.update({"table" : "products", "id" : 1513686608316989452, "doc" : {"price":18.5}});
UpdateDocumentRequest updateRequest = new UpdateDocumentRequest();
doc = new HashMap<String,Object >(){{
put("price",18.5);
}};
updateRequest.index("products").id(1513686608316989452L).setDoc(doc);
indexApi.update(updateRequest);
Dictionary<string, Object> doc = new Dictionary<string, Object>();
doc.Add("price", 18.5);
UpdateDocumentRequest updateDocumentRequest = new UpdateDocumentRequest(index: "products", id: 1513686608316989452L, doc: doc);
indexApi.Update(updateDocumentRequest);
res = await indexApi.update({ index: "test", id: 1, doc: { cat: 10 } });
updDoc = map[string]interface{} {"cat": 10}
updRequest = manticoreclient.NewUpdateDocumentRequest("test", updDoc)
updRequest.SetId(1)
res, _, _ = apiClient.IndexAPI.Update(context.Background()).UpdateDocumentRequest(*updRequest).Execute()
Query OK, 1 row affected (0.00 sec)
{
"table": "products",
"_id": 1513686608316989452,
"result": "updated"
}
- SQL
- JSON
- PHP
- Python
- javascript
- Java
- C#
- TypeScript
- Go
delete from products where price < 10;
POST /delete
{
"table": "products",
"query":
{
"range":
{
"price":
{
"lte": 10
}
}
}
}
$result = $index->deleteDocuments(new \Manticoresearch\Query\Range('price',['lte'=>10]));
indexApi.delete({"table" : "products", "query": {"range":{"price":{"lte":10}}}})
res = await indexApi.delete({"table" : "products", "query": {"range":{"price":{"lte":10}}}});
DeleteDocumentRequest deleteRequest = new DeleteDocumentRequest();
query = new HashMap<String,Object>();
query.put("range",new HashMap<String,Object>(){{
put("price",new HashMap<String,Object>(){{
put("lte",10);
}});
}});
deleteRequest.index("products").setQuery(query);
indexApi.delete(deleteRequest);
Dictionary<string, Object> price = new Dictionary<string, Object>();
price.Add("lte", 10);
Dictionary<string, Object> range = new Dictionary<string, Object>();
range.Add("price", price);
DeleteDocumentRequest deleteDocumentRequest = new DeleteDocumentRequest(index: "products", range: range);
indexApi.Delete(deleteDocumentRequest);
res = await indexApi.delete({
index: 'test',
query: { match: { '*': 'Text 1' } },
});
delRequest := manticoreclient.NewDeleteDocumentRequest("test")
matchExpr := map[string]interface{} {"*": "Text 1t"}
delQuery := map[string]interface{} {"match": matchExpr }
delRequest.SetQuery(delQuery)
res, _, _ := apiClient.IndexAPI.Delete(context.Background()).DeleteDocumentRequest(*delRequest).Execute();
Query OK, 1 row affected (0.00 sec)
{
"table": "products",
"deleted": 1
}
Array
(
[_index] => products
[deleted] => 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 from starting at boot time, run:
sudo systemctl disable manticore
To make Manticore start at boot, run:
sudo systemctl enable manticore
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 -u manticore
systemctl set-environment _ADDITIONAL_SEARCHD_PARAMS
allows you to specify custom startup flags that the Manticore Search daemon should be started with. See full list here.
For example, to start Manticore with the 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 the manticore
user and all files created by the server will be owned by this user. If searchd
is started under, for example, the root user, the file permissions will be changed, which may result in issues when running searchd
as a service again.
You can also start Manticore Search by calling searchd
(Manticore Search server binary) directly:
searchd [OPTIONS]
Note that without specifying a path to the configuration file, searchd
will try to find it in several locations depending on the operating system.
The options available to searchd
in all operating systems are:
-
--help
(-h
for short) lists all of the parameters that can be used in your particular build ofsearchd
. -
--version
(-v
for short) shows Manticore Search version information. -
--config <file>
(-c <file>
for short) tellssearchd
to use the specified file as its configuration. -
--stop
is used to asynchronously stopsearchd
, using the details of the PID file as specified in the Manticore configuration file. Therefore, you may also need to confirm tosearchd
which configuration file to use with the--config
option. Example:$ searchd --config /etc/manticoresearch/manticore.conf --stop
-
--stopwait
is used to synchronously stopsearchd
.--stop
essentially tells the running instance to exit (by sending it a SIGTERM) and then immediately returns.--stopwait
will also attempt to wait until the runningsearchd
instance actually finishes the shutdown (eg. saves all the pending attribute changes) and exits. Example:$ searchd --config /etc/manticoresearch/manticore.conf --stopwait
Possible exit codes are as follows:
- 0 on success
- 1 if connection to running searchd server failed
- 2 if server reported an error during shutdown
- 3 if server crashed during shutdown
-
--status
command is used to query runningsearchd
instance status using the connection details from the (optionally) provided configuration file. It will try to connect to running instance using the first found UNIX socket or TCP port from the configuration file. On success it will query for a number of status and performance counter values and print them. You can also use SHOW STATUS command to access the very same counters via SQL protocol. Examples:$ searchd --status $ searchd --config /etc/manticoresearch/manticore.conf --status
-
--pidfile
is used to explicitly force using a PID file (where thesearchd
process identification number is stored) despite any other debugging options that say otherwise (for instance,--console
). This is a debugging option.$ searchd --console --pidfile
-
--console
is used to forcesearchd
into console mode. Typically, Manticore runs as a conventional server application and logs information into log files (as specified in the configuration file). However, when debugging issues in the configuration or the server itself, or trying to diagnose hard-to-track-down problems, it may be easier to force it to dump information directly to the console/command line from which it is being called. Running in console mode also means that the process will not be forked (so searches are done in sequence) and logs will not be written to. (It should be noted that console mode is not the intended method for runningsearchd
.) You can invoke it as:$ searchd --config /etc/manticoresearch/manticore.conf --console
-
--logdebug
,--logreplication
,--logdebugv
, and--logdebugvv
options enable additional debug output in the server log. They differ by the logging verboseness level. These are debugging options and should not be normally enabled, as they can pollute the log a lot. They can be used temporarily on request to assist with complicated debugging sessions. -
--iostats
is used in conjunction with the logging options (thequery_log
must have been activated inmanticore.conf
) to provide more detailed information on a per-query basis about the input/output operations carried out in the course of that query, with a slight performance hit and slightly bigger logs. The IO statistics don't include information about IO operations for attributes, as these are loaded with mmap. To enable it, you can startsearchd
as follows:$ searchd --config /etc/manticoresearch/manticore.conf --iostats
-
--cpustats
is used to provide actual CPU time report (in addition to wall time) in both query log file (for every given query) and status report (aggregated). It depends onclock_gettime()
Linux system call or falls back to less precise call on certain systems. You might startsearchd
thus:$ searchd --config /etc/manticoresearch/manticore.conf --cpustats
-
--port portnumber
(-p
for short) is used to specify the port that Manticore should listen on to accept binary protocol requests, usually for debugging purposes. This will usually default to 9312, but sometimes you need to run it on a different port. Specifying it on the command line will override anything specified in the configuration file. The valid range is 0 to 65535, but ports numbered 1024 and below usually require a privileged account in order to run.An example of usage:
$ searchd --port 9313
-
--listen ( address ":" port | port | path ) [ ":" protocol ]
(or-l
for short) Works as--port
, but allows you to specify not only the port, but the full path, IP address and port, or Unix-domain socket path thatsearchd
will listen on. In other words, you can specify either an IP address (or hostname) and port number, just a port number, or a Unix socket path. If you specify a port number but not the address, searchd will listen on all network interfaces. A Unix path is identified by a leading slash. As the last parameter, you can also specify a protocol handler (listener) to be used for connections on this socket. Supported protocol values are 'sphinx' and 'mysql' (MySQL protocol used since 4.1). -
--force-preread
forbids the server from serving any incoming connection until prereading of table files completes. By default, at startup, the server accepts connections while table files are lazy-loaded into memory. This extends the behavior and makes it wait until the files are loaded. -
--index (--table) <table>
(or-i (-t) <table>
for short) forces this instance ofsearchd
to only serve the specified table. Like--port
, above, this is usually for debugging purposes; more long-term changes would generally be applied to the configuration file itself. -
--strip-path
strips the path names from all the file names referenced from the table (stopwords, wordforms, exceptions, etc). This is useful for picking up tables built on another machine with possibly different path layouts. -
--replay-flags=<OPTIONS>
switch can be used to specify a list of extra binary log replay options. The supported options are:accept-desc-timestamp
, ignore descending transaction timestamps and replay such transactions anyway (the default behavior is to exit with an error).ignore-open-errors
, ignore missing binlog files (the default behavior is to exit with an error).ignore-trx-errors
, ignore any transaction errors and skip current binlog file (the default behavior is to exit with an error).ignore-all-errors
, ignore any errors described above (the default behavior is to exit with an error).
Example:
$ searchd --replay-flags=accept-desc-timestamp
-
--coredump
is used to enable saving a core file or a minidump of the server on crash. Disabled by default to speed up of server restart on crash. This is useful for debugging purposes.$ searchd --config /etc/manticoresearch/manticore.conf --coredump
-
--new-cluster
bootstraps a replication cluster and makes the server a reference node with cluster restart protection. On Linux you can also runmanticore_new_cluster
. It will start Manticore in--new-cluster
mode via systemd. -
--new-cluster-force
bootstraps a replication cluster and makes the server a reference node bypassing cluster restart protection. On Linux you can also runmanticore_new_cluster --force
. It will start Manticore in--new-cluster-force
mode via systemd. -
--mockstack
analyzes and reports the necessary stack sizes for recursive expression evaluation, pattern matching operations, and filter processing. This debugging option outputs calculated stack requirements to the console for optimization purposes. The output provides environment variables that can be used to configure stack requirements for different operations.Example:
$ searchd --mockstack Manticore 7.4.7 e90b5afbb@25032706 dev (columnar 4.1.2 15bbcc7@25031206) (secondary 4.1.2 15bbcc7@25031206) (knn 4.1.2 15bbcc7@25031206) Copyright (c) 2001-2016, Andrew Aksyonoff Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) Copyright (c) 2017-2025, Manticore Software LTD (https://manticoresearch.com) export MANTICORE_KNOWN_CREATE_SIZE=200 export MANTICORE_START_KNOWN_CREATE_SIZE=4504 export MANTICORE_KNOWN_EXPR_SIZE=16 export MANTICORE_START_KNOWN_EXPR_SIZE=200 export MANTICORE_NONE=32 export MANTICORE_START_NONE=104 export MANTICORE_KNOWN_FILTER_SIZE=224 export MANTICORE_START_KNOWN_FILTER_SIZE=11192 export MANTICORE_KNOWN_MATCH_SIZE=320 export MANTICORE_START_KNOWN_MATCH_SIZE=14552 export NO_STACK_CALCULATION=1
There are some options for searchd
that are specific to Windows platforms, concerning handling as a service, and are only available in Windows binaries.
Note that in Windows searchd will default to --console
mode, unless you install it as a service.
-
--install
installssearchd
as a service into the Microsoft Management Console (Control Panel / Administrative Tools / Services). Any other parameters specified on the command line, where--install
is specified will also become part of the command line on future starts of the service. For example, as a part of callingsearchd
, you will likely also need to specify the configuration file with--config
, and you would do that as well as specifying--install
. Once called, the usual start/stop facilities will become available via the management console, so any methods you could use for starting, stopping and restarting services would also apply tosearchd
. Example:C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install --config C:\Manticore\manticore.conf
If you want to have the I/O stats every time you start
searchd
, you need to specify the option on the same line as the--install
command thus:C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install --config C:\Manticore\manticore.conf --iostats
-
--delete
removes the service from the Microsoft Management Console and other places where services are registered, after previously being installed with--install
. Note that this does not uninstall the software or delete the tables. It means the service will not be called from the services system, and will not be started on the machine's next start. If currently running as a service, the current instance will not be terminated (until the next reboot or until--stop
). If the service was installed with a custom name (with--servicename
), the same name will need to be specified with--servicename
when calling to uninstall. Example:C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --delete
-
--servicename <name>
applies the given name tosearchd
when installing or deleting the service, as it would appear in the Management Console; this will default to searchd, but if being deployed on servers where multiple administrators may log in to the system, or a system with multiplesearchd
instances, a more descriptive name may be applicable. Note that unless combined with--install
or--delete
, this option does not do anything. Example:C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install --config C:\Manticore\manticore.conf --servicename ManticoreSearch
-
--ntservice
is an option that is passed by the Microsoft Management Console tosearchd
to invoke it as a service on Windows platforms. It would not normally be necessary to call this directly; this would normally be called by Windows when the service is started, although if you wanted to call this as a regular service from the command-line (as the complement to--console
) you could do so in theory. -
--safetrace
forcessearchd
to only use the system's backtrace() call in crash reports. In certain (rare) scenarios, this might be a "safer" way to get that report. This is a debugging option. -
--nodetach
switch (Linux only) tellssearchd
not to detach into the background. This will also cause log entries to be printed out to the console. Query processing operates as usual. This is a debugging option and might also be useful when you run Manticore in a Docker container to capture its output.
Manticore utilizes the plugin_dir for storing and using Manticore Buddy plugins. By default, this value is accessible to the "manticore" user in a standard installation. However, if you start the searchd daemon manually with a different user, the daemon might not have access to the plugin_dir
. To address this problem, ensure you specify a plugin_dir
in the common section that the user running the searchd daemon can write to.
searchd
supports a number of signals:
SIGTERM
- Initiates a clean shutdown. New queries will not be handled, but queries that are already started will not be forcibly interrupted.SIGHUP
- Initiates tables rotation. Depending on the value of seamless_rotate setting, new queries might be shortly stalled; clients will receive temporary errors.SIGUSR1
- Forces reopen of searchd log and query log files, allowing for log file rotation.
MANTICORE_TRACK_DAEMON_SHUTDOWN=1
enables detailed logging while searchd is shutting down. It's useful in case of some shutdown problems, such as when Manticore takes too long to shut down or freezes during the shutdown process.