Сlient 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.1
Minimum Manticore Search version is 2.5.1 with HTTP protocol enabled.
Manticore Search | manticoresearch-javascript | Node |
---|---|---|
>= 6.2.0 | 3.3.1 | >= 10.0 |
>= 4.2.1 | 3.0.x | >= 10.0 |
>= 4.0.2 | 2.0.3 | >= 10.0 |
>= 2.5.1 | 2.0.2 | >= 8.0 |
npm install manticoresearch
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));
}
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.
All URIs are relative to http://127.0.0.1:9308
Class | Method | HTTP request | Description |
---|---|---|---|
Manticoresearch.IndexApi | bulk | POST /bulk | Bulk index operations |
Manticoresearch.IndexApi | callDelete | POST /delete | Delete a document in an index |
Manticoresearch.IndexApi | insert | POST /insert | Create a new document in an index |
Manticoresearch.IndexApi | replace | POST /replace | Replace new document in an index |
Manticoresearch.IndexApi | update | POST /update | Update a document in an index |
Manticoresearch.SearchApi | percolate | POST /pq/{index}/search | Perform reverse search on a percolate index |
Manticoresearch.SearchApi | search | POST /search | Performs a search on an index |
Manticoresearch.UtilsApi | sql | POST /sql | Perform SQL requests |
- Manticoresearch.Aggregation
- Manticoresearch.AggregationSortInnerValue
- Manticoresearch.AggregationTerms
- Manticoresearch.BoolFilter
- Manticoresearch.BulkResponse
- Manticoresearch.DeleteDocumentRequest
- Manticoresearch.DeleteResponse
- Manticoresearch.EqualsFilter
- Manticoresearch.ErrorResponse
- Manticoresearch.Facet
- Manticoresearch.FilterBoolean
- Manticoresearch.FilterNumber
- Manticoresearch.FilterString
- Manticoresearch.GeoDistanceFilter
- Manticoresearch.GeoDistanceFilterLocationAnchor
- Manticoresearch.Highlight
- Manticoresearch.HighlightField
- Manticoresearch.InFilter
- Manticoresearch.InsertDocumentRequest
- Manticoresearch.MatchFilter
- Manticoresearch.MatchOp
- Manticoresearch.MatchOpFilter
- Manticoresearch.MatchPhraseFilter
- Manticoresearch.NotFilterBoolean
- Manticoresearch.NotFilterNumber
- Manticoresearch.NotFilterString
- Manticoresearch.PercolateRequest
- Manticoresearch.PercolateRequestQuery
- Manticoresearch.QueryFilter
- Manticoresearch.RangeFilter
- Manticoresearch.SearchRequest
- Manticoresearch.SearchResponse
- Manticoresearch.SearchResponseHits
- Manticoresearch.SortMVA
- Manticoresearch.SortMultiple
- Manticoresearch.SortOrder
- Manticoresearch.SourceByRules
- Manticoresearch.SuccessResponse
- Manticoresearch.UpdateDocumentRequest
- Manticoresearch.UpdateResponse
All endpoints do not require authorization.