Skip to content

manticoresoftware/manticoresearch-javascript

Repository files navigation

manticoresearch

Low-level client for Manticore Search.

❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-javascript/tree/3.3.0

Requirements

Node v8.

Minimum Manticore Search version is 2.5.1 with HTTP protocol enabled.

Manticore Search manticoresearch-javascript Node
>= 4.2.1 3.0.x >= 10.0
>= 4.0.2 2.0.3 >= 10.0
>= 2.5.1 2.0.2 >= 8.0

Installation

npm install manticoresearch 

Documentation

Full documentation is available in docs folder.

Manticore Search server documentation: https://manual.manticoresearch.com.

Getting Started

Please follow the installation instruction and execute the following Javascript code:

var Manticoresearch = require('manticoresearch');
var client = new Manticoresearch.ApiClient();
client.basePath="http://localhost:9308";
/*
If a custom http agent is needed, e.g., to enable keep-alive connections, the 'requestAgent' option can be set to override 'superagent' agent instance used by default:
client.requestAgent = new http.Agent({
  keepAlive: true,
  maxSockets: 1,
  keepAliveMsecs: 1000
});
*/

var api = new Manticoresearch.IndexApi(client)
var body = ["'{\"insert\": {\"index\": \"test\", \"id\": 1, \"doc\": {\"title\": \"Title 1\"}}},\\n{\"insert\": {\"index\": \"test\", \"id\": 2, \"doc\": {\"title\": \"Title 2\"}}}'"]; // {String} 
api.bulk(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to http://127.0.0.1:9308

Class Method HTTP request Description
Manticoresearch.IndexApi bulk POST /json/bulk Bulk index operations
Manticoresearch.IndexApi callDelete POST /json/delete Delete a document in an index
Manticoresearch.IndexApi insert POST /json/insert Create a new document in an index
Manticoresearch.IndexApi replace POST /json/replace Replace new document in an index
Manticoresearch.IndexApi update POST /json/update Update a document in an index
Manticoresearch.SearchApi percolate POST /json/pq/{index}/search Perform reverse search on a percolate index
Manticoresearch.SearchApi search POST /json/search Performs a search
Manticoresearch.UtilsApi sql POST /sql Perform SQL requests

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.