4.0.0 • Published 6 months ago

manticoresearch v4.0.0

Weekly downloads
28
License
MIT
Repository
-
Last release
6 months ago

Manticore Javascript client

Сlient for Manticore Search.

Requirements

Minimum Manticore Search version is 2.5.1 with HTTP protocol enabled.

Manticore Searchmanticoresearch-javascriptNode
>= 6.2.04.0.0>= 10.0
>= 6.2.03.3.1>= 10.0
>= 4.2.13.0.x>= 10.0
>= 4.0.22.0.3>= 10.0
>= 2.5.12.0.2>= 8.0

Installation

npm install manticoresearch 

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);
});

var searchApi = new Manticoresearch.SearchApi(client);

// Create SearchRequest
var searchRequest = new Manticoresearch.SearchRequest();
searchRequest.index = "test";
searchRequest.fulltext_filter = new Manticoresearch.QueryFilter('Star Trek 2');

// Perform a search
async function(){
    var res = await searchApi.search(searchRequest);
    console.log(JSON.stringify(res, null, 4));
}

Documentation

Full documentation on the API Endpoints and Models used is available in docs folder as listed below.

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

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
Manticoresearch.IndexApibulkPOST /bulkBulk index operations
Manticoresearch.IndexApicallDeletePOST /deleteDelete a document in an index
Manticoresearch.IndexApiinsertPOST /insertCreate a new document in an index
Manticoresearch.IndexApireplacePOST /replaceReplace new document in an index
Manticoresearch.IndexApiupdatePOST /updateUpdate a document in an index
Manticoresearch.SearchApipercolatePOST /pq/{index}/searchPerform reverse search on a percolate index
Manticoresearch.SearchApisearchPOST /searchPerforms a search on an index
Manticoresearch.UtilsApisqlPOST /sqlPerform SQL requests

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

4.0.0

6 months ago

3.3.1

7 months ago

3.3.0

11 months ago

3.2.1

2 years ago

3.1.0

2 years ago

2.0.3

2 years ago

2.0.2

3 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago